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, Prefix.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.

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