How to restrict user to enter character in phone text field
Get contacts of all your emergency needs on single tap. Download Quick-Finder for iPhone
1) Take a text field let its name is phoneTextField.
2) attach delegate of phoneTextField to FileOwner.
you can do it by code as
3) implement the delegate UITextFieldDelegate in .h file.
4) Put a macro before @implementation
5) implement the following method as:
NSCharacterSet *unacceptedInput = nil;
if(textField== self. phoneTextField)
unacceptedInput = [[NSCharacterSet characterSetWithCharactersInString:NUMERIC] invertedSet];
return ([[string componentsSeparatedByCharactersInSet:unacceptedInput] count] <= 1);}