Swiftpack.co -  nerdzlab/NerdzValidation as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
nerdzlab/NerdzValidation
Validation Library
.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: 1
Last commit: 5 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Release Notes

32 weeks ago

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