Generic Instance Method


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


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



The key path of the property to assign.


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.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software