Skip to content

Instantly share code, notes, and snippets.

@frontweb
Created May 4, 2011 09:47
Show Gist options
  • Save frontweb/955011 to your computer and use it in GitHub Desktop.
Save frontweb/955011 to your computer and use it in GitHub Desktop.
Get UITextField text as you type
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
NSMutableString* newText = [[NSMutableString alloc] init];
[newText appendString:[textField.text substringWithRange:NSMakeRange(0, range.location)]];
[newText appendString:string];
NSLog(@"newText: %@", newText);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment