CocoaPods trunk is moving to be read-only. Read more on the blog, there are 17 months to go.

NerdzValidation 2.0.9

NerdzValidation 2.0.9

Maintained by NerdzLab.



NerdzValidation

Package to easy validate text just by passing validation rules!

Code Examples

To validate email text field, that is required and should be have at least 4 and at most 200 characters:

let validationRules: [ValidationRule] = [
            NotEmptyRule(errorMessage: errorMessage),
            ShouldBeInRangeRule(
                lowerBoundErrorMessage: errorMessage,
                upperBoundErrorMessage: errorMessage,
                lowerBound: 4,
                upperBound: 200
            ),
            RegexValidationRule(regexPattern: regexString, errorMessage: errorMessage)
        ]
"[email protected]".validate(with: validationRules)