Generic Instance Method

receive(subscriber:)

Attaches the specified subscriber to this publisher.

Required.

Declaration

func receive<S>(subscriber: S) where S : Subscriber, Self.Failure == S.Failure, Self.Output == S.Input

Parameters

subscriber

The subscriber to attach to this Publisher, after which it can receive values.

Discussion

Implementations of Publisher must implement this method.

The provided implementation of subscribe(_:) calls this method.

See Also

Working with Subscribers

func subscribe<S>(S)

Attaches the specified subscriber to this publisher.

Beta
func subscribe<S>(S) -> AnyCancellable

Attaches the specified subject to this publisher.

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