adamwaite / Validator

Drop in user input validation for your iOS apps.
MIT License
1.42k stars 218 forks source link

Give an example to validate an email address #114

Closed intonarumori closed 5 years ago

intonarumori commented 5 years ago

Please give a straightforward example to validate an email string: let email: String?

Let's check for a value first (required) then for pattern (valid email address)

From the many examples it's not clear how to do it. I was only able to do it by unwrapping the value first, but that just defeats the purpose of the library.

Also, you give some examples with ValidationError but that class is nowhere to be found. Please consider including it as a helper class and rewriting the examples with them instead of someValidationErrorType.

adamwaite commented 5 years ago

Duplicate of https://github.com/adamwaite/Validator/issues/90. Fixing now.