Skip to content

Instantly share code, notes, and snippets.

@Arrlindii
Created August 5, 2018 23:01
Show Gist options
  • Select an option

  • Save Arrlindii/de0f9e4ed4b6de71a038852ca0941171 to your computer and use it in GitHub Desktop.

Select an option

Save Arrlindii/de0f9e4ed4b6de71a038852ca0941171 to your computer and use it in GitHub Desktop.
func validate() {
let emailValidator = VaildatorFactory.validatorFor(type: .email)
do {
try emailValidator.validate(emailTextField.text)
}catch(let error) {
showAlert(for: (error as! ValidationError).message)
}
let validatedEmail = emailTextField.text!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment