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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -