ios - How do I get the "old value" from a ReactiveCocoa signal? -
if i'm using racable this:
[racablewithstart(self.myprop) subscribenext:^(id x) { // stuff }];
how can can access old value of myprop (before change caused signal fire)? can access this:
[racablewithstart(self.myprop) subscribenext:^(id x) { // stuff id newvalue = x; id oldvalue = rac_oldvalue; }];
i have used snippet success:
[[object rac_valuesandchangesforkeypath:@"property" options:nskeyvalueobservingoptionold observer:self] subscribenext:^(ractuple *tuple) { id newobject = tuple.first; nsdictionary *change = tuple.second; id oldobject = change[nskeyvaluechangeoldkey]; }];
source: reactivecocoa documentation
Comments
Post a Comment