Created
January 16, 2011 02:00
-
-
Save abrahamvegh/781470 to your computer and use it in GitHub Desktop.
If there’s a better way to do this, I’ll eat my code.
This file contains hidden or 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
- (BOOL) textField: (UITextField *) textField shouldChangeCharactersInRange: (NSRange) range replacementString: (NSString *) string | |
{ | |
([(textField == self.serverField ? self.emailField : self.serverField).text length] > 0 && | |
[(textField == self.passwordField ? self.emailField : self.passwordField).text length] > 0 && | |
[[textField.text stringByReplacingCharactersInRange: range withString: string] length] > 0 | |
) ? (self.navigationItem.rightBarButtonItem.enabled = YES) : (self.navigationItem.rightBarButtonItem.enabled = NO) ; | |
return YES; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment