Generic Instance Method

assign(to:on:)

Assigns the value of a KVO-compliant property from a publisher.

Declaration

func assign<Root>(to keyPath: ReferenceWritableKeyPath<Root, A.Output>, on object: Root) -> AnyCancellable
Available when Failure is Never.

Parameters

keyPath

The key path of the property to assign.

object

The object on which to assign the value.

Return Value

A cancellable instance; used when you end KVO-based assignment of the key path’s value.