Swift3 UITextField in UIAlert validation after button pressed
问题 I have implemented alert window with two text fields. And I want to perform some validation: if one of text fields is blank (user did not input any value), application should not allow user to press the "Done" button. I don't want to show any alerts, just want to not allow user to save blank data. I have created the function listed below. Added two guards with return. But in this case if user did not input anything, alert just closes and nothing is saved. I don't want alert window to be