Skip to content

Instantly share code, notes, and snippets.

@Arrlindii
Created August 21, 2018 17:47
Show Gist options
  • Select an option

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

Select an option

Save Arrlindii/18a6e056d61f0d28867b3c0c3e94ee8f to your computer and use it in GitHub Desktop.
extension UITextField {
func validatedText(validationType: ValidatorType) throws -> String {
switch validationType {
case .email: //Validation Logic to determine if text is an email
case .name: //Validation Logic to determine if text is allowed to represent a name
case .requiredField: //Validation Logic to determine if text is provided
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment