SubscriptionReferenceBag
public class SubscriptionReferenceBag
A class to hold subscriptions to SubscriptionReferenceType
.
Very similar to autoreleasepool
but specifically for disposable types.
Disposes of all held subscriptions when deallocated or dispose()
is called.
-
Initialise an empty bag.
Declaration
Swift
public init()
-
Initialise the bag with an array of subscription references.
Declaration
Swift
public init(_ references: SubscriptionReferenceType?...)
-
Add a new reference to the bag if the reference is not
nil
.Declaration
Swift
public func addReference(reference: SubscriptionReferenceType?)
-
Add a new reference to the bag if the reference is not
nil
.Declaration
Swift
public static func += (lhs: SubscriptionReferenceBag, rhs: SubscriptionReferenceType?)
-
Dispose of all subscriptions in the bag.
Declaration
Swift
public func dispose()