Swiftpack.co - nerdzlab/NerdzValidation as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by nerdzlab.
nerdzlab/NerdzValidation v1.0.1
Validation Library
⭐️ 2
🕓 1 year ago
.package(url: "https://github.com/nerdzlab/NerdzValidation.git", from: "v1.0.1")

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)

GitHub

link
Stars: 2
Last commit: 24 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

1 year ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics