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

Tells the subscriber that a publisher of void elements is ready to receive further requests.

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.

func store(in: inout Set<AnyCancellable>)

Stores this cancellable instance in the specified set.

See Also

Using Convenience Subscribers

class Subscribers.Sink

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