Created
May 19, 2021 09:33
-
-
Save thatswiftguy/05797057c06d0ee64b311d7a471b2ce9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func isValidEmail(_ email: String) -> Bool { | |
let emailCode = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,64}" | |
let emailPredicate = NSPredicate(format:"SELF MATCHES %@", emailCode) | |
return emailPredicate.evaluate(with: email) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment