A publisher that provides an explicit means of connecting and canceling publication.


protocol ConnectablePublisher


Use makeConnectable() to create a ConnectablePublisher from any publisher whose failure type is Never.


Performing Explicit Connections

func connect() -> Cancellable

Connects to the publisher and returns a Cancellable instance with which to cancel publishing.


Connecting Automatically

func autoconnect() -> Publishers.Autoconnect<Self>

Automates the process of connecting or disconnecting from this connectable publisher.

See Also


protocol Publisher

Declares that a type can transmit a sequence of values over time.

enum Publishers

A namespace for types that serve as publishers.

struct AnyPublisher

A publisher that performs type erasure by wrapping another publisher.

struct Published

A type that publishes a property marked with an attribute.

protocol Cancellable

A protocol indicating that an activity or action supports cancellation.

class AnyCancellable

A type-erasing cancellable object that executes a provided closure when canceled.