Skip to content

Instantly share code, notes, and snippets.

@Arrlindii
Created August 5, 2018 23:02
Show Gist options
  • Save Arrlindii/17c18494be783d122f576c997d0cb72e to your computer and use it in GitHub Desktop.
Save Arrlindii/17c18494be783d122f576c997d0cb72e to your computer and use it in GitHub Desktop.
extension UITextField {
func validatedText(validationType: ValidatorType) throws -> String {
let validator = VaildatorFactory.validatorFor(type: validationType)
return try validator.validated(self.text!)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment