EmailValidator
一个简单(但正确)的用于验证电子邮件地址的库。支持rfc5322中定义的电子邮件地址以及新的国际化电子邮件地址标准(rfc653x)。基于https://github.com/jstedfast/EmailValidation
安装
将以下内容添加到Podfile中:pod 'EmailValidator'
使用
基本
EmailValidator.validate("[email protected]")
其他选项
EmailValidator.validate(email: "[email protected]",
allowTopLevelDomains: true, // true/false, will allow top level domains
allowInternational: true) // true/false, will allow international addresses (e.g cyrillic or chinese)