Generic Class

Subscribers.Assign

A simple subscriber that assigns received elements to a property indicated by a key path.

Declaration

final class Assign<Root, Input>

Topics

Declaring Subscriber Topography

typealias Subscribers.Assign.Failure

The kind of errors this subscriber might receive.

Creating an Assign Subscriber

init(object: Root, keyPath: ReferenceWritableKeyPath<Root, Input>)

Creates a subscriber to assign the value of a property indicated by a key path.

Inspecting the Assigned Property

var object: Root?

The object that contains the property to assign.

let keyPath: ReferenceWritableKeyPath<Root, Input>

The key path that indicates the property to assign.

Instance Properties

var combineIdentifier: CombineIdentifier

A unique identifier for identifying publisher streams.

var customMirror: Mirror

A mirror that reflects the subscriber.

var description: String

A textual representation of this subscriber.

var playgroundDescription: Any

A custom playground description for this subscriber.

Instance Methods

func cancel()

Cancel the activity.

func receive() -> Subscribers.Demand
func receive(Input) -> Subscribers.Demand

Tells the subscriber that the publisher has produced an element.

func receive(completion: Subscribers.Completion<Never>)

Tells the subscriber that the publisher has completed publishing, either normally or with an error.

func receive(subscription: Subscription)

Tells the subscriber that it has successfully subscribed to the publisher and may request items.

See Also

Using Convenience Subscribers

class Subscribers.Sink

A simple subscriber that requests an unlimited number of values upon subscription.

Beta

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