Instance Method

autoconnect()

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

Declaration

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

Return Value

A publisher which automatically connects to its upstream connectable publisher.

Discussion

Use autoconnect() to simplify working with ConnectablePublisher instances, such as those created with makeConnectable().

let autoconnectedPublisher = somePublisher
    .makeConnectable()
    .autoconnect()
    .subscribe(someSubscriber)

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