It might look simple but I cannot find a solution for this. In my application, I have many UITextFields. For example, let’s say I have a UITextField called textField. When I enter a string into textField, I should validate whether string is alphanumeric. How can I do this?
I also have a button, apart from textField. After entering into textField, when I press button, I should validate whether the entered string is alphanumeric by showing it with NSLog. So can anyone help me solving this with some example or sample code?
You can try following-
This bool will return true only if your string is alphanumeric and not numeric only.
EDITED:-
To Log bool-
And to return from this function –
Also if you want to show some alert then you can write code for presenting the alert above return statement.