Skip to content
This repository was archived by the owner on Nov 12, 2024. It is now read-only.
/ RVValidator Public archive
forked from BadChoice/RVValidator

Simple, fast and effective textfield validator

License

Notifications You must be signed in to change notification settings

revosystems/RVValidator

 
 

Repository files navigation

RVValidator

Laravel inspired validator for iOS Forms

Installation

Copy the category files to your project or just

    pod 'RVValidator' 

Examples

Just some examples, check the .h or the tests to see them all

   validator = [RVValidator make:@[
        TFValidator(self.requiredField, @"required"),
        TFValidator(self.numericField,  @"numeric"),
        TFValidator(self.emailField,    @"required|email"),
        TFValidator(self.urlField,      @"url"),
        TFValidator(self.dateField,     @"date:dd-MM-yyyy"),
        TFValidator(self.sizeField,     @"size:4"),
        TFValidator(self.rangeField,    @"min:4|max:10")
        ]
     ];
    
    [validator addLiveValidation];
    
    //You can even get live valid status with
    
    [validator addLiveValidation:^(BOOL isValid){
        self.submitButton.enabled = isValid;
    }];

Available rules

  • Date
  • Email
  • Integer
  • Max
  • Min
  • Numeric
  • Regexp
  • Required
  • Size
  • Time
  • Url
  • In > To check that the value is in any of the string list in:1,2,3
  • NotIn > To check that the value is not in any of the string list notIn:1,2,3
  • ConfirmationRule > To match that two fields are equal

About

Simple, fast and effective textfield validator

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 99.2%
  • Ruby 0.8%