RACChannel Class Reference
Inherits from | NSObject |
Declared in | RACChannel.h RACChannel.m |
Overview
A two-way channel.
Conceptually, RACChannel can be thought of as a bidirectional connection, composed of two controllable signals that work in parallel.
For example, when connecting between a view and a model:
Model View
leadingTerminal
——> followingTerminal
leadingTerminal
<—— followingTerminal
The initial value of the model and all future changes to it are sent on the
leadingTerminal
, and received by subscribers of the followingTerminal
.
Likewise, whenever the user changes the value of the view, that value is sent
on the followingTerminal
, and received in the model from the
leadingTerminal
. However, the initial value of the view is not received
from the leadingTerminal
(only future changes).
Properties
followingTerminal
The terminal which “follows” the lead of the other terminal, only sending
future values to the subscribers of the leadingTerminal
.
@property (nonatomic, strong, readonly) RACChannelTerminal *followingTerminal
Discussion
The latest value sent to the leadingTerminal
(if any) will be sent
immediately to new subscribers of this terminal, and then all future values
as well.
Declared In
RACChannel.h
leadingTerminal
The terminal which “leads” the channel, by sending its latest value
immediately to new subscribers of the followingTerminal
.
@property (nonatomic, strong, readonly) RACChannelTerminal *leadingTerminal
Discussion
New subscribers to this terminal will not receive a starting value, but will
receive all future values that are sent to the followingTerminal
.
Declared In
RACChannel.h