Back to Rxswift

RefCountDisposable

docs/Classes/RefCountDisposable.html

6.10.21.2 KB
Original Source

RefCountDisposable

public final class RefCountDisposable : DisposeBase, Cancelable

Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed.

`

                isDisposed
                `

Declaration

Swift

public var isDisposed: Bool { get }

Return Value

Was resource disposed.

`

                init(disposable:)
                `

Initializes a new instance of the RefCountDisposable.

Declaration

Swift

public init(disposable: Disposable)

`

                retain()
                `

Holds a dependent disposable that when disposed decreases the refcount on the underlying disposable.

When getter is called, a dependent disposable contributing to the reference count that manages the underlying disposable’s lifetime is returned.

Declaration

Swift

public func retain() -> Disposable

`

                dispose()
                `

Disposes the underlying disposable only when all dependent disposables have been disposed.

Declaration

Swift

public func dispose()