How to check if UITextField's text is valid email?

后端 未结 5 1134
清酒与你
清酒与你 2020-12-28 23:45

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 e

5条回答
  •  再見小時候
    2020-12-29 00:20

    If you are targeting iOS 4.0 or greater, you might also consider NSRegularExpression and do more nuanced checking of the UITextField contents along the lines of this, for example.

提交回复
热议问题