Skip to content

Instantly share code, notes, and snippets.

@nrj
Created November 20, 2013 18:09
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 nrj/7568073 to your computer and use it in GitHub Desktop.
Save nrj/7568073 to your computer and use it in GitHub Desktop.
Force uppercase input in UITextField.
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
NSString *newString = [[textField text] stringByReplacingCharactersInRange:range withString:string];
[textField setText:[newString uppercaseString]];
return NO;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment