Disposable

public protocol Disposable : AnyObject

Represents something that can be “disposed”, usually associated with freeing resources or canceling work.

  • Whether this disposable has been disposed already.

    Declaration

    Swift

    var isDisposed: Bool { get }
  • Disposing of the resources represented by self. If self has already been disposed of, it does nothing.

    Note

    Implementations must issue a memory barrier.

    Declaration

    Swift

    func dispose()