File tree Expand file tree Collapse file tree 5 files changed +13
-11
lines changed
Expand file tree Collapse file tree 5 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ Pod::Spec.new do |s|
88 s . author = { "Jeff" => "jeff.potter6@gmail.com" }
99 s . social_media_url = "http://twitter.com/jpotts18"
1010 s . platform = :ios
11- s . ios . deployment_target = '8.0'
1211 s . source = { :git => "https://github.com/jpotts18/swift-validator.git" , :tag => "2.0.1" }
1312 s . source_files = "Validator/*.swift"
1413end
Original file line number Diff line number Diff line change @@ -21,9 +21,10 @@ class EmailRule: Rule {
2121 }
2222
2323 func validate( value: String ) -> Bool {
24- let test = NSPredicate ( format: " SELF MATCHES %@ " , self . REGEX)
25- if test. evaluateWithObject ( value) {
26- return true
24+ if let test = NSPredicate ( format: " SELF MATCHES %@ " , self . REGEX) {
25+ if test. evaluateWithObject ( value) {
26+ return true
27+ }
2728 }
2829 return false
2930 }
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ class MinLengthRule : Rule {
2222 }
2323
2424 func validate( value: String ) -> Bool {
25- if count ( value) < DEFAULT_MIN_LENGTH {
25+ if countElements ( value) < DEFAULT_MIN_LENGTH {
2626 return false
2727 }
2828 return true
Original file line number Diff line number Diff line change @@ -31,9 +31,10 @@ class PasswordRule : Rule {
3131 }
3232
3333 func validate( value: String ) -> Bool {
34- let test = NSPredicate ( format: " SELF MATCHES %@ " , self . REGEX)
35- if test. evaluateWithObject ( value) {
36- return true
34+ if let test = NSPredicate ( format: " SELF MATCHES %@ " , self . REGEX) {
35+ if test. evaluateWithObject ( value) {
36+ return true
37+ }
3738 }
3839 return false
3940 }
Original file line number Diff line number Diff line change @@ -19,9 +19,10 @@ class ZipCodeRule: Rule {
1919 }
2020
2121 func validate( value: String ) -> Bool {
22- let test = NSPredicate ( format: " SELF MATCHES %@ " , self . REGEX)
23- if test. evaluateWithObject ( value) {
24- return true
22+ if let test = NSPredicate ( format: " SELF MATCHES %@ " , self . REGEX) {
23+ if test. evaluateWithObject ( value) {
24+ return true
25+ }
2526 }
2627 return false
2728 }
You can’t perform that action at this time.
0 commit comments