Skip to content

Instantly share code, notes, and snippets.

@joanmolinas
Last active May 23, 2016 12:35
Show Gist options
  • Save joanmolinas/9619657ce2279b77b69fada4667240d6 to your computer and use it in GitHub Desktop.
Save joanmolinas/9619657ce2279b77b69fada4667240d6 to your computer and use it in GitHub Desktop.
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
if (range.location == textField.text.length && [string isEqualToString:@" "]) {
textField.text = [textField.text stringByAppendingString:@"\u00a0"];
return NO;
}
return YES;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment