- Support for Swift 3.0
- Support for Carthage
- Support for pure Swift
classorstructvalidation - Support for conditional validation with
when(condition)syntax - New Data validators:
minByteSize/maxByteSize- the minimal/maximal size of validated data in bytesimage/video/audio/archive- whether validated data represents image/video/audio/archivemimeType- whether validated data has given MIMEType. For full list of supported MIMETypes go here
- New Date validators:
earlierThanUnixTimestamp- whether validated date is earlier than specified UNIX epochearlierThanOrEqualToUnixTimestamp- whether validated date is earlier than or equal to specified UNIX epochlaterThanUnixTimestamp- whether validated date is later than specified UNIX epochlaterThanOrEqualToUnixTimestamp- whether validated date is later than or equal to specified UNIX epoch
- New Image validators:
minRatio/maxRatio- the minimal/maximal ratio of the validated imageminWidth/maxWidth- the minimal/maximal pixel width of the validated imageminHeight/maxHeight- the minimal/maximal pixel height of the validated imageminSize/maxSize- the minimal/maximal pixel size of the validated image
- New String validators:
emoji- whether validated string contains emoji
- Validators for syntaxes:
- http, https
- ws, wss
- IPv4, IPv6
- Domains (like
example.com) - UUID
- Geographic coordinates
- Price
- ISBN
- Hexadecimal color
- Phone number
- Postal code
- revealing
NGRValidatorDomainasexternby rad3ks - introducing additional
NGRValidatorPropertyNameKeykey toerror.userInfoby paweldudek
- Introduced new array validators:
includes- whether given object is included in validated array property or not.excludes- whether given object is excluded from validated array property or not.includedIn- whether validated property is included in given array.excludedFrom- whether validated property is excluded from given array.
- OSX 10.7+ support.
-
Introduced:
VALIDATOR_SHORTHAND. Feel free to usevalidate(...)instead ofNGRValidate(...)NGRMessagingdelegate as an alternative to inlinemsg_methods declared inrulesblock.- Sugar syntax like
is,has,to,toNotand so on. It improves readability and makes rules to have more natural tone. - new
NGRValidatorlogo. - Continuous Integration.
-
Syntax changes:
NGRSyntaxURLbecomesNGRSyntaxHTTP, because this method checks whether a string is HTTP link or not.NGRErrorenum toNGRMsgKey *in order toNGRMessagingdelegate introduction.
-
Improved:
- Header documenatation.
- Tests. Migrated from Kiwi to Specta/Expecta.
-
Deprecated methods in
NGRValidatorclass:
| Deprecated | Replacement |
|---|---|
validateValue:named:usingRules: |
validateValue:named:rules: |
validateModel:error:usingRules: |
validateModel:error:delegate:rules: |
validateModel:error:scenario:usingRules: |
validateModel:error:scenario:delegate:rules: |
validateModel:usingRules |
validateModel:delegate:rules: |
validateModel:scenario:usingRules |
validateModel:scenario:delegate:rules: |
- Fixed issue with passing error as
nilrather than NULL reference*error;
- Fixed bug occurring when multiplie scenarios were given.
- Syntax changes:
trueValue()becomesbeTrue()falseValue()becomesbeFalse()
- Fixed issue with passing nil to blocks.
- Make
regex()validator accept pattern and options, not a regex object.