Skip to content

lucatorella/FormValidator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

FormValidator

A form validator in Swift.

Getting started

FormValidator is built around this simple protocol:

protocol Validator {
    func validate() -> Result<Void, [ValidationError]>
}

Every validator class should implement it, from the simple PasswordValidator, to a more complex SignInValidator or your custom form validator. I've already introduced a couple of classes, that you can tweak based on your requirements, and you can build more on top of that.

A simple example:

SignInValidator(email: emailField.text, password: passwordField.text).validate()

About

Form Validator Swift

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages