Latest 1.0.6
Homepage https://github.com/fromkk/FKValidator
License MIT
Platforms ios 8.0, requires ARC
Authors

FKValidator is library of validation with Swift.

Usage

let validator :FKValidator = FKValidator()

Add rules

// Required rule
validator.addRule(FKValidatorRuleRequired())

// max length
validator.addRule(FKValidatorRuleMaxLength(length: 10))

Check validation

validator.run("string") //true
validator.run("10 length.") //true

validator.run("11 length..") //false
validator.errors // Array <NSError>

Custom message

validator.addRule(FKValidatorRuleExactLength(length: 5, "value is not 5 length."))
validator.run("1234")
validator.errors // Array <NSError NSLocalizedDescriptionKey: "value is not 5 length." >

Latest podspec

{
    "name": "FKValidator",
    "version": "1.0.6",
    "summary": "FKValidator is library of validation with Swift.",
    "homepage": "https://github.com/fromkk/FKValidator",
    "license": "MIT",
    "authors": {
        "fromkk": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/fromkk/FKValidator.git",
        "tag": "1.0.6"
    },
    "source_files": [
        "Classes/*.swift",
        "Classes/**/*.swift"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This