Issues dismissing keyboard conditionally with on iPhone
- by Chris
I have an app that has a username and password field. I want to validate the input before the the user is allowed to stop editing the field. To do that, I'm using the textFieldShouldEndEditing delegate method. If the input doesn't validate I display a UIAlertView.
This approach works as advertised - the user cannot leave the field if the input doesn't validate.
To have the done button on the keyboard dismiss the keyboard, I call resignFirstResponder on the textfield.
The issue I have is the alert is being called twice. How do I keep the alert from showing twice?