views:

92

answers:

0

What's the best practice for validating user input in a UITextField and displaying error? I tried performing checks inside textFieldShouldReturn and textFieldShouldEndEditing and popping up an error box when userever inputted invalid content.

However, during testing, the popup from textFieldShouldEndEditing is getting invoked multiple times. My simple test was to input invalid text in TextFieldA and navigate directly to TextFieldB. I observed 3 error popups, all generated by textFieldShouldReturn