Being a newbie to ReactiveCocoa, I hope for some tips:
I am trying to create a dynamic form containing several Field objects processed by an XML file. Each field can have several validation rules that will be executed with the Field parameter NSString *value.
For the RAC part of the question
inside each Field object, I want to bind BOOL completedto a signal that checks the Field parameter *valuefor an array of rules. So far, I got my opinion here:
@implementation Field
self = [super init];
if (self) {
RAC(self, completed) = [RACObserve(self, value) filter:^BOOL(NSString *fieldValue) {
NSLog(@"%s::self.completed = %d\n", sel_getName(_cmd), self.completed);
NSLog(@"%s::fieldValue = %@\n", sel_getName(_cmd), fieldValue);
return [self validateCurrentValue];
}];
}
return self;
The parameter is *valuealready bound to my view model (successfully), and it is updated every time a text field changes.
, , , , , - .