I want to combine the rac_signalForControlEvent
on a UIButton with some combined textFields signals like so:
[[[[self.loginButton rac_signalForControlEvents:UIControlEventTouchUpInside]
combineLatestWith:textFieldsCombinedSignal]
filter:^BOOL(RACTuple *signals) {
return ((UIButton *)[signals first]).highlighted;
}] subscribeNext:^(RACTuple *signals) {
if ([signals.second boolValue])
{
[self doLogin];
}
else
{
[self error];
}
}];
But this way I have to filter for the button highlighted state otherwise the subscribeNext:
block is getting fired every time some of the textfields change (textFieldsCombinedSignal
).
I would love to achieve this without having to filter for the highlighted button's state (I'm using ReactiveCocoa to minimize state after all, and I don't feel like this is the proper way to do what I'm trying to do).