Reputation: 1481
I am trying to make a UITextField meant for names, but can't figure out how to restrict it to letters ONLY. I know numbers only is possible, but how is letters only possible?
Upvotes: 0
Views: 70
Reputation: 3477
Use a delegate and implement:
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
Validate the replacement string here.
Upvotes: 1