this new existing project is using Objective-C Code with RACObserve(Reactive cocoa ) to read api responses. I want to convert obj-c to swift .
Current Obj-c Implementation is :
@interface ObjCTableViewCell : UITableViewCell
@property (nonatomic, strong) OfferPersonal *offer;
@end
.m class->
- (void)bindToModel {
[RACObserve(self, offer.lender.name) subscribeNext:^(id x) {
self.nameLabel.text = x;
}];
}
Controller ->
{
ObjCTableViewCell TableViewCell *myCell;
myCell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
[myCell setValue:self.offer forKey:@"offerPersonal"];
[myCell bindToModel];
}
Now how to use RACObserve in Swift. i tried to search it over other places. (http://blog.scottlogic.com/2014/07/24/mvvm-reactivecocoa-swift.html)could not understand exactly .