In my iPad application, I have an UITextField. User should only type numerical. If user types alphabets or alphanumeric text then there should be an alert message saying “Enter only numerical”. What condition should I apply which would find the entered text is numeric, alphabet or alphanumeric?
Any help would be highly appreciated.
Thanks and regards
PC
Implement the
UITextFieldDelegatemethodYou can then reject certain characters inside of that method.
Alternatively, set the keyboard style to:
.keyboardType = UIKeyboardTypePhonePad;