Latest 1.0.7
Homepage https://github.com/fromkk/TMValidator
License MIT
Platforms ios 8.0
Authors

Description

iOSでバリデーションをする為のクラスです。

Usage

UITextField *firstName = [[UITextField alloc] init];
firstName.text = @"名";

UITextField *lastName  = [[UITextField alloc] init];
lastName.text = @"姓";

TMValidatorField *fieldFirstName = [TMValidatorField fieldWithValue:firstName.text andLabel:@"firstName" andElement:firstName];
[[fieldFirstName addRule:[TMValidatorRuleRequired rule]] addRule:[TMValidatorRuleMaxLength ruleWithLength:@10]];

TMValidatorField *fieldLastName  = [TMValidatorField fieldWithValue:lastName.text andLabel:@"lastName" andElement:lastName];
[[fieldLastName addRule:[TMValidatorRuleRequired rule]] addRule:[TMValidatorRuleMaxLength ruleWithLength:@10]];

TMValidator *validator = [TMValidator validator];
[[validator addField:fieldFirstName] addField:fieldLastName];

[validator runWithSuccesses:^(NSArray *successes) {
    NSLog(@"success! %@", successes);
} andFailure:^(NSArray *errors) {
    NSLog(@"failure! %@", errors);
}];

Latest podspec

{
    "name": "TMValidator",
    "version": "1.0.7",
    "summary": "Validation of NSString written by Objective-C for iOS.",
    "homepage": "https://github.com/fromkk/TMValidator",
    "license": "MIT",
    "authors": {
        "Kazuya Ueoka": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/fromkk/TMValidator.git",
        "tag": "1.0.7"
    },
    "source_files": [
        "Sources",
        "Sources/*.{h,m}"
    ],
    "public_header_files": "Sources/*.h",
    "resources": "Sources/**/*.strings"
}

Pin It on Pinterest

Share This