I have a UIAlertView with a textField on it and two buttons: Save & Cancel. When the Save button is tapped I am checking if the text field isn’t empty and after if it is I simply want to change the textFields placeholder to: @”enter a name please” and KEEP the alert view on screen. However it is automatically dismissed.
How do I override that?
Add a target to the textfield in a subclassed alertView. You can subclass the alertView and not dismiss as described in this post
Then write a function called textFieldDidChange that checks the current textfield of your alertView and set a boolean value so you know whether or not to dismiss the alert.
* Alternatively, I would suggest disabling “Save” when it is empty and not have to subclass. *