NSObject(RACKVOWrapper) Category Reference
Declared in | NSObject+RACKVOWrapper.h NSObject+RACKVOWrapper.m |
Overview
RAC-specific KVO change dictionary key: Will be @YES if the change only affected the value of the last key path component leaving the values of the intermediate key path components unaltered, @NO otherwise.
Instance Methods
rac_observeKeyPath:options:observer:block:
Adds the given block as the callbacks for when the key path changes.
- (RACDisposable *)rac_observeKeyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options observer:(NSObject *)observer block:(void ( ^ ) ( id value , NSDictionary *change ))block
Discussion
Unlike direct KVO observation, this handles deallocation of weak
properties
by generating an appropriate notification. This will only occur if there is
an @property
declaration visible in the observed class, with the weak
memory management attribute.
The observation does not need to be explicitly removed. It will be removed when the observer or the receiver deallocate.
keyPath - The key path to observe. Must not be nil. options - The KVO observation options. observer - The object that requested the observation. May be nil. block - The block called when the value at the key path changes. It is passed the current value of the key path and the extended KVO change dictionary including RAC-specific keys and values. Must not be nil.
Returns a disposable that can be used to stop the observation.
Declared In
NSObject+RACKVOWrapper.h