reactive cocoa 4 - RACObserve in RAC 4 -
i woking on new new swift 2 project using reactivecocoa4 , wondering how observe property change dit before in objc.
[racobserve(self,self.model.wifistate) subscribenext:^(id newvalue){ @strongify(self); self.wifistate = newvalue; }];
do have hint?
thanks
thierry
you can same using dynamicproperty:
dynamicproperty(object: self.model, keypath: "wifistate") .signal // or `producer` if care current value .map { $0 as! wifistate } // necessary because there no way infer type of given keypath. .observenext { [unowned self] self.wifistate = $0 }
Comments
Post a Comment