RACSerialDisposable Class Reference
| Inherits from | RACDisposable : NSObject |
| Declared in | RACSerialDisposable.h RACSerialDisposable.m |
Overview
A disposable that contains exactly one other disposable and allows it to be swapped out atomically.
Properties
disposable
The inner disposable managed by the serial disposable.
@property (atomic, strong) RACDisposable *disposableDiscussion
This property is thread-safe for reading and writing. However, if you want to read the current value and write a new one atomically, use swapInDisposable: instead.
Disposing of the receiver will also dispose of the current disposable set for this property, then set the property to nil. If any new disposable is set after the receiver is disposed, it will be disposed immediately and this property will remain set to nil.
Declared In
RACSerialDisposable.hClass Methods
serialDisposableWithDisposable:
Creates a serial disposable which will wrap the given disposable.
+ (instancetype)serialDisposableWithDisposable:(RACDisposable *)disposableDiscussion
disposable - The value to set for disposable. This may be nil.
Returns a RACSerialDisposable, or nil if an error occurs.
Declared In
RACSerialDisposable.hInstance Methods
dispose
Performs the disposal work. Can be called multiple times, though sebsequent calls won’t do anything.
- (void)disposeDeclared In
RACDisposable.hisDisposed
Whether the receiver has been disposed.
- (BOOL)isDisposedDiscussion
Use of this property is discouraged, since it may be set to YES
concurrently at any time.
This property is not KVO-compliant.
Declared In
RACDisposable.hswapInDisposable:
Atomically swaps the receiver’s disposable for newDisposable.
- (RACDisposable *)swapInDisposable:(RACDisposable *)newDisposableDiscussion
newDisposable - The new value for disposable. If the receiver has already
been disposed, this disposable will be too, and disposable
will remain set to nil. This argument may be nil.
Returns the previous value for the disposable property.
Declared In
RACSerialDisposable.h