+[RACSignal zip:]
doesn't always give you the latest value on each of the signals you pass into it. It gives you the next value from each signal. That means that if you have the following marble diagram:
Signal A | -(a0)-------------(a1)-----x
|
Signal B | ----(b0)-(b1)-(b2)----(b3)--->
|
zip:A,B | ----(a0,b0)-------(a1,b1)--x
|
+-------------------------------
-- Time -->
Your signal will be sent (a0, b0)
when b0
is sent, then (a1, b1)
when a1
is sent, and then no more values will be sent because Signal A
completes after only two values.
+[RACSignal combineLatest:reduce:]
, on the other hand, will always give you the latest value on each of the signals you pass into it whenever either signal sends a value (after all signals have sent at least one value):
Signal A | -(a0)-----------------------(a1)-----x
|
Signal B | ----(b0)----(b1)----(b2)------------(b3)---->
|
cl/r:A,B | ----(a0,b0)-(a0,b1)-(a0,b2)-(a1,b2)-(a1,b3)->
|
+----------------------------------------------
-- Time -->