Created
October 29, 2014 06:29
-
-
Save bobspryn/a731e8026c2143eaf2e3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void) viewDidLoad { | |
//... | |
RACSignal *usernameIsValidSignal = RACObserve(self.viewModel, isUsernameValid); | |
RAC(self.goButton, enabled) = usernameIsValidSignal; | |
RAC(self.goButton, alpha) = [usernameIsValidSignal | |
map:^id(NSNumber *usernameIsValid) { | |
return usernameIsValid.boolValue ? @1.0 : @0.5; | |
}]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment