docs/Classes/CompositeDisposable.html
public final class CompositeDisposable : DisposeBase, Cancelable
Represents a group of disposable resources that are disposed together.
`
DisposeKey
`
Key used to remove disposable from composite disposable
Swift
public struct DisposeKey
`
isDisposed
`
Swift
public var isDisposed: Bool { get }
`
init()
`
Undocumented
Swift
override public init()
`
init(_:_:)
`
Initializes a new instance of composite disposable with the specified number of disposables.
Swift
public init(_ disposable1: Disposable, _ disposable2: Disposable)
`
init(_:_:_:)
`
Initializes a new instance of composite disposable with the specified number of disposables.
Swift
public init(_ disposable1: Disposable, _ disposable2: Disposable, _ disposable3: Disposable)
`
init(_:_:_:_:_:)
`
Initializes a new instance of composite disposable with the specified number of disposables.
Swift
public init(_ disposable1: Disposable, _ disposable2: Disposable, _ disposable3: Disposable, _ disposable4: Disposable, _ disposables: Disposable...)
`
init(disposables:)
`
Initializes a new instance of composite disposable with the specified number of disposables.
Swift
public init(disposables: [Disposable])
`
insert(_:)
`
Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed.
Swift
public func insert(_ disposable: Disposable) -> DisposeKey?
| disposable |
Disposable to add.
|
Key that can be used to remove disposable from composite disposable. In case dispose bag was already disposed nil will be returned.
`
count
`
Swift
public var count: Int { get }
Gets the number of disposables contained in the CompositeDisposable.
`
remove(for:)
`
Removes and disposes the disposable identified by disposeKey from the CompositeDisposable.
Swift
public func remove(for disposeKey: DisposeKey)
| disposeKey |
Key used to identify disposable to be removed.
|
`
dispose()
`
Disposes all disposables in the group and removes them from the group.
Swift
public func dispose()