Supporting Types

  • A protocol indicating that an activity or action may be canceled.

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

    See more

    Declaration

    Swift

    public protocol Cancellable
  • A type-erasing cancellable object that executes a provided closure when canceled or deallocated.

    AnyCancellable is thread-safe; concurrent invocations to cancel() are permitted and it is guaranteed that the closure is only ever invoked once. There is no guarantee however on which thread the closure will be called.

    See more

    Declaration

    Swift

    public final class AnyCancellable : Cancellable