- Support for Swift 3.0
- Support for Carthage
- Support for pure Swift
class
orstruct
validation - 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
NGRValidatorDomain
asextern
by rad3ks - introducing additional
NGRValidatorPropertyNameKey
key toerror.userInfo
by 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(...)
NGRMessaging
delegate as an alternative to inlinemsg_
methods declared inrules
block.- Sugar syntax like
is
,has
,to
,toNot
and so on. It improves readability and makes rules to have more natural tone. - new
NGRValidator
logo. - Continuous Integration.
-
Syntax changes:
NGRSyntaxURL
becomesNGRSyntaxHTTP
, because this method checks whether a string is HTTP link or not.NGRError
enum toNGRMsgKey *
in order toNGRMessaging
delegate introduction.
-
Improved:
- Header documenatation.
- Tests. Migrated from Kiwi to Specta/Expecta.
-
Deprecated methods in
NGRValidator
class:
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
nil
rather 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.