https://github.com/badchoice/rvvalidator
Simple, fast and effective textfield validator
https://github.com/badchoice/rvvalidator
Last synced: about 1 year ago
JSON representation
Simple, fast and effective textfield validator
- Host: GitHub
- URL: https://github.com/badchoice/rvvalidator
- Owner: BadChoice
- License: mit
- Created: 2017-09-22T16:31:02.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2021-10-19T11:14:11.000Z (over 4 years ago)
- Last Synced: 2025-05-29T17:47:27.487Z (about 1 year ago)
- Language: Objective-C
- Size: 60.5 KB
- Stars: 0
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# 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