Protocol

Cancellable

A protocol indicating that an activity or action supports cancellation.

Declaration

protocol Cancellable

Overview

Calling cancel() frees up any allocated resources. It also stops side effects such as timers, network access, or disk I/O.

Topics

Canceling Actions

func cancel()

Cancel the activity.

Required.

Storing Cancellable Instances

func store<C>(in: inout C)

Stores this cancellable instance in the specified collection.

func store(in: inout Set<AnyCancellable>)

Stores this cancellable instance in the specified set.

Relationships

Inherited By

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

A type that publishes a property marked with an attribute.

Beta
class AnyCancellable

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

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