RACKVOChannel Class Reference
Inherits from | RACChannel : NSObject |
Declared in | RACKVOChannel.h RACKVOChannel.m |
Overview
A RACChannel that observes a KVO-compliant key path for changes. Methods needed for the convenience macro. Do not call explicitly.
Instance Methods
initWithTarget:keyPath:nilValue:
Initializes a channel that will observe the given object and key path.
- (id)initWithTarget:(NSObject *)target keyPath:(NSString *)keyPath nilValue:(id)nilValue
Discussion
The current value of the key path, and future KVO notifications for the given
key path, will be sent to subscribers of the channel’s followingTerminal
.
Values sent to the followingTerminal
will be set at the given key path using
key-value coding.
When the target object deallocates, the channel will complete. Signal errors are considered undefined behavior.
This is the designated initializer for this class.
target - The object to bind to.
keyPath - The key path to observe and set the value of.
nilValue - The value to set at the key path whenever a nil
value is
received. This may be nil when connecting to object properties, but
an NSValue should be used for primitive properties, to avoid an
exception if nil
is received (which might occur if an intermediate
object is set to nil
).
Declared In
RACKVOChannel.h