Skip to content

Instantly share code, notes, and snippets.

@bobspryn
Last active August 29, 2015 14:08
Show Gist options
  • Save bobspryn/8a019580d7a3fc829746 to your computer and use it in GitHub Desktop.
Save bobspryn/8a019580d7a3fc829746 to your computer and use it in GitHub Desktop.
- (void)textFieldDidChange:(UITextField *)sender {
// update the view-model
self.viewModel.username = sender.text;
// check if things are now valid
self.goButton.enabled = self.viewModel.isUsernameValid;
self.goButton.alpha = self.viewModel.isUsernameValid ? 1.0 : 0.5;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment