登陆界面的用法
RAC(self.logInButton, enabled) = [RACSignal
combineLatest:@[self.usernameTextField.rac_textSignal,
self.passwordTextField.rac_textSignal,
RACObserve(LoginManager.sharedManager, loggingIn),
RACObserve(self, loggedIn)
] reduce:^(NSString *username, NSString *password, NSNumber *loggingIn, NSNumber *loggedIn) {
return @(username.length > 0 && password.length > 0 && !loggingIn.boolValue && !loggedIn.boolValue);
}];
[[RACSignal
combineLatest:@[self.firstNameField.rac_textSignal, self.lastNameField.rac_textSignal]
reduce:^(NSString*firstName, NSString *lastName){
return @(firstName.length> 0 && lastName.length> 0);
}] toProperty:@"enabled" onObject:self.button];