Created
August 21, 2018 17:48
-
-
Save Arrlindii/2d0e0bab3ba3c5a9828ca8f62c5f1314 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
| enum VaildatorFactory { | |
| static func validatorFor(type: ValidatorType) -> ValidatorConvertible { | |
| switch type { | |
| case .email: return EmailValidator() | |
| case .name(let fieldName) : return NameValidator(fieldName) | |
| case .requiredField(let fieldName): return RequiredFieldValidator(fieldName) | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment