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.
-
Declaration
Swift
public var isDisposed: Bool { get }
Return Value
Was resource disposed.
-
Initializes a new instance of the
RefCountDisposable
.Declaration
Swift
public init(disposable: Disposable)
-
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
-
Disposes the underlying disposable only when all dependent disposables have been disposed.
Declaration
Swift
public func dispose()