Class

AnyCancellable

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

Declaration

final class AnyCancellable

Overview

Subscriber implementations can use this type to provide a “cancellation token” that makes it possible for a caller to cancel a publisher, but not to use the Subscription object to request items.

Topics

Creating a Type-Erased Cancellable

init(() -> Void)

Initializes the cancellable object with the given cancel-time closure.

Canceling Actions

Initializers

Relationships

Conforms To

See Also

Publishers

protocol Publisher

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

Beta
enum Publishers

A namespace for types that serve as publishers.

Beta
struct AnyPublisher

A type-erasing publisher.

Beta
protocol ConnectablePublisher

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

Beta
struct Published

The publisher for properties published by using an attribute.

Beta
protocol Cancellable

A protocol indicating that an activity or action supports cancellation.

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