Skip to content

Instantly share code, notes, and snippets.

@joshaber
Created February 14, 2013 18:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshaber/11f13b2d3b58141d085e to your computer and use it in GitHub Desktop.
Save joshaber/11f13b2d3b58141d085e to your computer and use it in GitHub Desktop.
RACSignal *formValid = [RACSignal
combineLatest:@[
self.firstNameField.rac_textSignal,
self.lastNameField.rac_textSignal,
self.emailField.rac_textSignal,
self.reEmailField.rac_textSignal
]
reduce:^(NSString *firstName, NSString *lastName, NSString *email, NSString *reEmail) {
return @(firstName.length > 0 && lastName.length > 0 && email.length > 0 && reEmail.length > 0 && [email isEqual:reEmail]);
}];
RAC(self.createButton.enabled) = formValid;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment