SerialDisposable

public final class SerialDisposable : DisposeBase, Cancelable

Represents a disposable resource whose underlying disposable resource can be replaced by another disposable resource, causing automatic disposal of the previous underlying disposable resource.

  • Declaration

    Swift

    public var isDisposed: Bool { get }

    Return Value

    Was resource disposed.

  • Initializes a new instance of the SerialDisposable.

    Declaration

    Swift

    override public init()
  • Gets or sets the underlying disposable.

    Assigning this property disposes the previous disposable object.

    If the SerialDisposable has already been disposed, assignment to this property causes immediate disposal of the given disposable object.

    Declaration

    Swift

    public var disposable: Disposable { get set }
  • Disposes the underlying disposable as well as all future replacements.

    Declaration

    Swift

    public func dispose()