Back to Rxswift

SerialDisposable

docs/Classes/SerialDisposable.html

6.10.21.2 KB
Original Source

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.

`

                isDisposed
                `

Declaration

Swift

public var isDisposed: Bool { get }

Return Value

Was resource disposed.

`

                init()
                `

Initializes a new instance of the SerialDisposable.

Declaration

Swift

override public init()

`

                disposable
                `

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 }

`

                dispose()
                `

Disposes the underlying disposable as well as all future replacements.

Declaration

Swift

public func dispose()