I have a UITextField. While the user is typing, I use
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
to check the string. And if the string is valid, I want to include a return key; if it is invalid, I want to disable the return key. Is there any way to do this?
For example, the return key will be disabled when the user enters characters in avai . Then the refund will be enabled after the user has completed entering the text avail . Then the return will be disabled again, as the user types availabl ; then turns back on when the user enters available .
source share