I have a view controller with 3 UITextFields (username, email, and password).
I need a method that checks first, if all fields have text in them, then check if the email’s textfield is a valid email, perhaps by checking if it has an @ sign in it. Can anyone help with this?
This will check a UITextField for a proper email.
Add this method to the textFields delegate then check if the characters it is about to change should be added or not.
Return
YESorNOdepending on the text fields current text compared to a valid email address:To check if a text field is empty or not just use
if (myTextField.text.length > 0) {}anywhere in your view controller.