From fb08dd1585ba6796d56a66610db0bf355d86d981 Mon Sep 17 00:00:00 2001 From: David Patterson Date: Fri, 29 Apr 2016 22:42:39 -0500 Subject: [PATCH 1/5] Update README.md Added code coverage requirement. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f76c986..06f5bd2 100644 --- a/README.md +++ b/README.md @@ -161,3 +161,4 @@ Swift Validator is written and maintained by Jeff Potter [@jpotts18](http://twit 3. Commit your changes `git commit -am 'Add some feature'` 4. Push to the branch `git push origin my-new-feature` 5. Create a new Pull Request +6. Make sure code coverage is above 70% From a2a2fb2858058c3f7eadca98e7b769b89ddc63d9 Mon Sep 17 00:00:00 2001 From: David Patterson Date: Fri, 29 Apr 2016 22:43:27 -0500 Subject: [PATCH 2/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 06f5bd2..cd2522f 100644 --- a/README.md +++ b/README.md @@ -161,4 +161,4 @@ Swift Validator is written and maintained by Jeff Potter [@jpotts18](http://twit 3. Commit your changes `git commit -am 'Add some feature'` 4. Push to the branch `git push origin my-new-feature` 5. Create a new Pull Request -6. Make sure code coverage is above 70% +6. Make sure code coverage is at least 70% From 839ef5202e38bcb3f2973ba049dce0b94ce645e0 Mon Sep 17 00:00:00 2001 From: David Patterson Date: Mon, 9 May 2016 14:08:52 -0500 Subject: [PATCH 3/5] Update README.md Added alternate CocoaPod install option to ensure SwiftValidator pod mirrors master branch. --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cd2522f..edf389d 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,10 @@ source 'https://github.com/CocoaPods/Specs.git' platform :ios, "8.1" use_frameworks! -pod 'SwiftValidator', '3.0.3' +# For SwiftValidator tag 3.0.3 +pod 'SwiftValidator', '3.0.3' +# Recommended: For the most recent version of SwiftValidator (master branch) +pod 'SwiftValidator', :git => 'https://github.com/jpotts18/SwiftValidator.git', :branch => 'master' ``` Install into your project: From 39530fb7d63c310e442086b47702c3f48c200e7f Mon Sep 17 00:00:00 2001 From: Deniz Adalar Date: Thu, 12 May 2016 10:48:21 +0300 Subject: [PATCH 4/5] Remove duplicate (unnecessary) functions by using default values for optional parameters --- SwiftValidator/Core/ValidationError.swift | 12 ------------ SwiftValidator/Core/Validator.swift | 13 +------------ 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/SwiftValidator/Core/ValidationError.swift b/SwiftValidator/Core/ValidationError.swift index d01ef51..313c016 100644 --- a/SwiftValidator/Core/ValidationError.swift +++ b/SwiftValidator/Core/ValidationError.swift @@ -17,18 +17,6 @@ public class ValidationError: NSObject { /// the error message of the field public let errorMessage:String - /** - Initializes `ValidationError` object with a textField and error. - - - parameter textField: UITextField that holds textField. - - parameter errorMessage: String that holds error message. - - returns: An initialized object, or nil if an object could not be created for some reason that would not result in an exception. - */ - public init(textField:UITextField, error:String){ - self.textField = textField - self.errorMessage = error - } - /** Initializes `ValidationError` object with a textField, errorLabel, and errorMessage. diff --git a/SwiftValidator/Core/Validator.swift b/SwiftValidator/Core/Validator.swift index d095628..9af2f49 100644 --- a/SwiftValidator/Core/Validator.swift +++ b/SwiftValidator/Core/Validator.swift @@ -96,17 +96,6 @@ public class Validator { self.errorStyleTransform = error } - /** - This method is used to add a field to validator. - - - parameter textField: field that is to be validated. - - parameter Rule: An array which holds different rules to validate against textField. - - returns: No return value - */ - public func registerField(textField:UITextField, rules:[Rule]) { - validations[textField] = ValidationRule(textField: textField, rules: rules, errorLabel: nil) - } - /** This method is used to add a field to validator. @@ -115,7 +104,7 @@ public class Validator { - parameter rules: A Rule array that holds different rules that apply to said textField. - returns: No return value */ - public func registerField(textField:UITextField, errorLabel:UILabel, rules:[Rule]) { + public func registerField(textField:UITextField, errorLabel:UILabel? = nil, rules:[Rule]) { validations[textField] = ValidationRule(textField: textField, rules:rules, errorLabel:errorLabel) } From a094156445c4ce28cfdc784652c7e36150af1584 Mon Sep 17 00:00:00 2001 From: Marco Pappalardo Date: Thu, 12 May 2016 10:45:56 +0200 Subject: [PATCH 5/5] fix #115: support for longer domain names from ICANN --- SwiftValidator/Rules/EmailRule.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SwiftValidator/Rules/EmailRule.swift b/SwiftValidator/Rules/EmailRule.swift index d407bf6..8839b5f 100644 --- a/SwiftValidator/Rules/EmailRule.swift +++ b/SwiftValidator/Rules/EmailRule.swift @@ -13,7 +13,7 @@ import Foundation public class EmailRule: RegexRule { /// Regular express string to be used in validation. - static let regex = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,6}" + static let regex = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}" /** Initializes an `EmailRule` object to validate an email text field.