NerdzValidation

1.0.1

Validation Library
nerdzlab/NerdzValidation

What's New

2020-12-17T14:01:32Z

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)
        ]
"someEmail@gmail.com".validate(with: validationRules)

Description

  • Swift Tools 5.3.0
View More Packages from this Author

Dependencies

  • None
Last updated: Fri Mar 15 2024 08:23:54 GMT-0900 (Hawaii-Aleutian Daylight Time)