From 0f8871426a31aaa2721e4617b28abedac621321d Mon Sep 17 00:00:00 2001
From: David Patterson
Date: Fri, 15 Apr 2016 17:09:16 -0500
Subject: [PATCH 1/3] updated codebase to reflect current codebase
---
SwiftValidator/Core/ValidationDelegate.swift | 2 +
SwiftValidator/Core/ValidationError.swift | 4 +-
SwiftValidator/Core/Validator.swift | 3 +-
SwiftValidator/Rules/AlphaNumericRule.swift | 11 +++
SwiftValidator/Rules/AlphaRule.swift | 11 +++
SwiftValidator/Rules/CharacterSetRule.swift | 24 +++++-
SwiftValidator/Rules/HexColorRule.swift | 10 +++
SwiftValidator/Rules/IPV4Rule.swift | 13 ++-
SwiftValidator/Rules/ISBNRule.swift | 89 ++++++++++++++++++++
SwiftValidator/Rules/MaxLengthRule.swift | 3 +-
SwiftValidator/Rules/MinLengthRule.swift | 3 +-
SwiftValidator/Rules/PhoneNumberRule.swift | 3 +-
SwiftValidator/Rules/RequiredRule.swift | 2 +
13 files changed, 170 insertions(+), 8 deletions(-)
diff --git a/SwiftValidator/Core/ValidationDelegate.swift b/SwiftValidator/Core/ValidationDelegate.swift
index 7e70372..b43ed95 100644
--- a/SwiftValidator/Core/ValidationDelegate.swift
+++ b/SwiftValidator/Core/ValidationDelegate.swift
@@ -14,11 +14,13 @@ import UIKit
@objc public protocol ValidationDelegate {
/**
This method will be called on delegate object when validation is successful.
+
- returns: No return value.
*/
func validationSuccessful()
/**
This method will be called on delegate object when validation fails.
+
- returns: No return value.
*/
func validationFailed(errors: [UITextField:ValidationError])
diff --git a/SwiftValidator/Core/ValidationError.swift b/SwiftValidator/Core/ValidationError.swift
index f962c95..d01ef51 100644
--- a/SwiftValidator/Core/ValidationError.swift
+++ b/SwiftValidator/Core/ValidationError.swift
@@ -19,6 +19,7 @@ public class ValidationError: NSObject {
/**
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.
@@ -29,7 +30,8 @@ public class ValidationError: NSObject {
}
/**
- Initializes ValidationError object with a textField, errorLabel, and errorMessage.
+ Initializes `ValidationError` object with a textField, errorLabel, and errorMessage.
+
- parameter textField: UITextField that holds textField.
- parameter errorLabel: UILabel that holds error label.
- parameter errorMessage: String that holds error message.
diff --git a/SwiftValidator/Core/Validator.swift b/SwiftValidator/Core/Validator.swift
index a600b2d..d095628 100644
--- a/SwiftValidator/Core/Validator.swift
+++ b/SwiftValidator/Core/Validator.swift
@@ -29,6 +29,7 @@ public class Validator {
/**
This method is used to validate all fields registered to Validator. If validation is unsuccessful,
field gets added to errors dictionary.
+
- returns: No return value.
*/
private func validateAllFields() {
@@ -58,6 +59,7 @@ public class Validator {
/**
This method is used to validate a single field registered to Validator. If validation is unsuccessful,
field gets added to errors dictionary.
+
- parameter textField: Holds validator field data.
- returns: No return value.
*/
@@ -149,7 +151,6 @@ public class Validator {
This method validates all fields in validator and sets any errors to errors parameter of callback.
- parameter callback: A closure which is called with errors, a dictionary of type UITextField:ValidationError.
-
- returns: No return value.
*/
public func validate(callback:(errors:[UITextField:ValidationError])->Void) -> Void {
diff --git a/SwiftValidator/Rules/AlphaNumericRule.swift b/SwiftValidator/Rules/AlphaNumericRule.swift
index 6a7f202..d21dfe8 100644
--- a/SwiftValidator/Rules/AlphaNumericRule.swift
+++ b/SwiftValidator/Rules/AlphaNumericRule.swift
@@ -8,7 +8,18 @@
import Foundation
+/**
+ `AlphaNumericRule` is a subclass of `CharacterSetRule`. It is used to verify that a field has a
+ valid list of alphanumeric characters.
+ */
public class AlphaNumericRule: CharacterSetRule {
+
+ /**
+ Initializes a `AlphaNumericRule` object to verify that field has valid set of alphanumeric characters.
+
+ - parameter message: String of 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(message: String = "Enter valid numeric characters") {
super.init(characterSet: NSCharacterSet.alphanumericCharacterSet(), message: message)
}
diff --git a/SwiftValidator/Rules/AlphaRule.swift b/SwiftValidator/Rules/AlphaRule.swift
index 8c31a82..95158d4 100644
--- a/SwiftValidator/Rules/AlphaRule.swift
+++ b/SwiftValidator/Rules/AlphaRule.swift
@@ -8,7 +8,18 @@
import Foundation
+/**
+ `AlphaRule` is a subclass of `CharacterSetRule`. It is used to verify that a field has a
+ valid list of alpha characters.
+ */
public class AlphaRule: CharacterSetRule {
+
+ /**
+ Initializes an `AlphaRule` object to verify that a field has valid set of alpha characters.
+
+ - parameter message: String of 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(message: String = "Enter valid alphabetic characters") {
super.init(characterSet: NSCharacterSet.letterCharacterSet(), message: message)
}
diff --git a/SwiftValidator/Rules/CharacterSetRule.swift b/SwiftValidator/Rules/CharacterSetRule.swift
index f29aaec..36875ca 100644
--- a/SwiftValidator/Rules/CharacterSetRule.swift
+++ b/SwiftValidator/Rules/CharacterSetRule.swift
@@ -8,16 +8,33 @@
import Foundation
+/**
+ `CharacterSetRule` is a subclass of `Rule`. It is used to validate IPV4 address fields.
+ */
public class CharacterSetRule: Rule {
-
+ /// NSCharacter that hold set of valid characters to hold
private let characterSet: NSCharacterSet
+ /// String that holds error message
private var message: String
+ /**
+ Initializes a `CharacterSetRule` object to verify that field has valid set of characters.
+
+ - parameter characterSet: NSCharacterSet that holds group of valid characters.
+ - parameter message: String of 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(characterSet: NSCharacterSet, message: String = "Enter valid alpha") {
self.characterSet = characterSet
self.message = message
}
+ /**
+ Used to validate field.
+
+ - parameter value: String to checked for validation.
+ - returns: Boolean value. True if validation is successful; False if validation fails.
+ */
public func validate(value: String) -> Bool {
for uni in value.unicodeScalars {
if !characterSet.longCharacterIsMember(uni.value) {
@@ -27,6 +44,11 @@ public class CharacterSetRule: Rule {
return true
}
+ /**
+ Displays error message when text field fails validation.
+
+ - returns: String of error message.
+ */
public func errorMessage() -> String {
return message
}
diff --git a/SwiftValidator/Rules/HexColorRule.swift b/SwiftValidator/Rules/HexColorRule.swift
index 1464984..10c5fa7 100644
--- a/SwiftValidator/Rules/HexColorRule.swift
+++ b/SwiftValidator/Rules/HexColorRule.swift
@@ -8,9 +8,19 @@
import Foundation
+/**
+ `HexColorRule` is a subclass of `RegexRule`. It is used to verify whether a field is a hexadecimal color.
+ */
public class HexColorRule: RegexRule {
+ /// Regular expression string that is used to verify hexadecimal
static let regex = "^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$"
+ /**
+ Initializes a `HexaColorRule` object to verify that field has text in hexadecimal color format.
+
+ - parameter message: String of 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(message: String = "Invalid regular expression") {
super.init(regex: HexColorRule.regex, message: message)
}
diff --git a/SwiftValidator/Rules/IPV4Rule.swift b/SwiftValidator/Rules/IPV4Rule.swift
index 44df5eb..5c024bd 100644
--- a/SwiftValidator/Rules/IPV4Rule.swift
+++ b/SwiftValidator/Rules/IPV4Rule.swift
@@ -8,10 +8,19 @@
import Foundation
+/**
+ `IPV4Rule` is a subclass of RegexRule that defines how a IPV4 address validated.
+ */
public class IPV4Rule: RegexRule {
-
+ /// Regular expression string that is used to verify IPV4 address.
static let regex = "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$"
-
+
+ /**
+ Initializes a `IPV4Rule` object to verify that field has text is an IPV4Rule address.
+
+ - parameter message: String of 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(message: String = "Must be a valid IPV4 address") {
super.init(regex: IPV4Rule.regex, message: message)
}
diff --git a/SwiftValidator/Rules/ISBNRule.swift b/SwiftValidator/Rules/ISBNRule.swift
index 9ea8cfb..493ab01 100644
--- a/SwiftValidator/Rules/ISBNRule.swift
+++ b/SwiftValidator/Rules/ISBNRule.swift
@@ -8,14 +8,30 @@
import Foundation
+/**
+ `ISBNRule` is a subclass of `Rule`. It is used to verify whether a field is a valid ISBN number.
+ */
public class ISBNRule: Rule {
+ /// String that holds error message
private let message: String
+ /**
+ Initializes a `ISBNRule` object to verify that field has text that is a ISBN number.
+
+ - parameter message: String of 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(message: String = "Enter valid ISBN number") {
self.message = message
}
+ /**
+ Method used to validate text field.
+
+ - parameter value: String to checked for validation.
+ - returns: Boolean value. True if validation is successful; False if validation fails.
+ */
public func validate(value: String) -> Bool {
guard let regex = try? NSRegularExpression(pattern: "[\\s-]", options: []) else {
@@ -27,25 +43,75 @@ public class ISBNRule: Rule {
return ISBN10Validator().verify(sanitized) || ISBN13Validator().verify(sanitized)
}
+ /**
+ Method used to dispaly error message when text field fails validation.
+
+ - returns: String of error message.
+ */
public func errorMessage() -> String {
return message;
}
}
+/**
+ `ISBNValidator` defines the protocol that objects adopting it must implement.
+*/
private protocol ISBNValidator {
+ /// Regular expression string
var regex: String { get }
+ /**
+ Method that actually verifies a ISBN number.
+
+ - parameter input: String that is to be validated against `ISBNRule`
+ - returns: A `Bool` that represents what happened during verification. `false` is returned if
+ it fails, `true` is returned if it was a success.
+ */
func verify(input: String) -> Bool
+ /**
+ Method that verifies regular expression is valid.
+
+ - parameter input: String that holds ISBN number being validated.
+ - returns: A `Bool` that represents the status of the ISBN number. `false` if ISBN number
+ was not valid, `true` if it was valid.
+ */
func checkRegex(input: String) -> Bool
+
+ /**
+ Method that verifies `ISBN` being validated is itself valid. It has to be either ISBN10
+ or ISBN13.
+
+ - parameter input: String that holds ISBN number being validated.
+ - returns: A `Bool` that represents the status of the ISBN number. `false` if ISBN number
+ was not valid, `true` if it was valid.
+ */
func verifyChecksum(input: String) -> Bool
}
+/**
+ `ISBNValidator` defines the extensions that are added to `ISBNValidator`.
+ */
extension ISBNValidator {
+ /**
+ Method that actually verifies a ISBN number.
+
+ - parameter input: String that is to be validated against `ISBNRule`
+ - returns: A `Bool` that represents what happened during verification. `false` is returned if
+ it fails, `true` is returned if it was a success.
+ */
func verify(input: String) -> Bool {
return checkRegex(input) && verifyChecksum(input)
}
+ /**
+ Method that verifies `ISBN` being validated is itself valid. It has to be either ISBN10
+ or ISBN13.
+
+ - parameter input: String that holds ISBN number being validated.
+ - returns: A `Bool` that represents the status of the ISBN number. `false` if ISBN number
+ was not valid, `true` if it was valid.
+ */
func checkRegex(input: String) -> Bool {
guard let _ = input.rangeOfString(regex, options: [.RegularExpressionSearch, .AnchoredSearch]) else {
return false
@@ -55,9 +121,21 @@ extension ISBNValidator {
}
}
+/**
+ `ISBN10Validator` is a struct that adopts the `ISBNValidator` protocol. Used to validate that
+ a field is an ISBN10 number.
+*/
private struct ISBN10Validator: ISBNValidator {
+ /// Regular expression used to validate ISBN10 number
let regex = "^(?:[0-9]{9}X|[0-9]{10})$"
+
+ /**
+ Checks that a string is an ISBN10 number.
+
+ - parameter input: String that is checked for ISBN10 validation.
+ - returns: `true` if string is a valid ISBN10 and `false` if it is not.
+ */
private func verifyChecksum(input: String) -> Bool {
var checksum = 0
@@ -79,9 +157,20 @@ private struct ISBN10Validator: ISBNValidator {
}
}
+/**
+ `ISBN13Validator` is a struct that adopts the `ISBNValidator` protocol. Used to validate that
+ a field is an ISBN13 number.
+*/
private struct ISBN13Validator: ISBNValidator {
+ /// Regular expression used to validate ISBN13 number.
let regex = "^(?:[0-9]{13})$"
+ /**
+ Checks that a string is an ISBN13 number.
+
+ - parameter input: String that is checked for ISBN13 validation.
+ - returns: `true` if string is a valid ISBN13 and `false` if it is not.
+ */
private func verifyChecksum(input: String) -> Bool {
let factor = [1, 3]
var checksum = 0
diff --git a/SwiftValidator/Rules/MaxLengthRule.swift b/SwiftValidator/Rules/MaxLengthRule.swift
index 4bec299..e01e6cd 100644
--- a/SwiftValidator/Rules/MaxLengthRule.swift
+++ b/SwiftValidator/Rules/MaxLengthRule.swift
@@ -19,7 +19,8 @@ public class MaxLengthRule: Rule {
public init(){}
/**
- Initializes a `MaxLengthRule` object that is to validate the length of the text of a text field
+ Initializes a `MaxLengthRule` object that is to validate the length of the text of a text field.
+
- parameter length: Maximum character length.
- parameter message: String of 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.
diff --git a/SwiftValidator/Rules/MinLengthRule.swift b/SwiftValidator/Rules/MinLengthRule.swift
index 2f63ab0..8b03241 100644
--- a/SwiftValidator/Rules/MinLengthRule.swift
+++ b/SwiftValidator/Rules/MinLengthRule.swift
@@ -21,7 +21,8 @@ public class MinLengthRule: Rule {
public init(){}
/**
- Initializes a `MaxLengthRule` object that is to validate the length of the text of a text field
+ Initializes a `MaxLengthRule` object that is to validate the length of the text of a text field.
+
- parameter length: Minimum character length.
- parameter message: String of error message.
- returns: An initialized `MinLengthRule` object, or nil if an object could not be created for some reason that would not result in an exception.
diff --git a/SwiftValidator/Rules/PhoneNumberRule.swift b/SwiftValidator/Rules/PhoneNumberRule.swift
index fc26ef0..e8dd546 100644
--- a/SwiftValidator/Rules/PhoneNumberRule.swift
+++ b/SwiftValidator/Rules/PhoneNumberRule.swift
@@ -17,7 +17,8 @@ public class PhoneNumberRule: RegexRule {
static let regex = "^\\d{10}$"
/**
- Method used to initialize `PhoneNumberRule` object.
+ Initializes a `PhoneNumberRule` object. Used to validate that a field has a valid phone number.
+
- parameter message: Error message that is displayed if validation fails.
- returns: An initialized `PasswordRule` object, or nil if an object could not be created for some reason that would not result in an exception.
*/
diff --git a/SwiftValidator/Rules/RequiredRule.swift b/SwiftValidator/Rules/RequiredRule.swift
index 1a25b43..cb71889 100644
--- a/SwiftValidator/Rules/RequiredRule.swift
+++ b/SwiftValidator/Rules/RequiredRule.swift
@@ -16,6 +16,8 @@ public class RequiredRule: Rule {
private var message : String
/**
+ Initializes `RequiredRule` object with error message. Used to validate a field that requires text.
+
- parameter message: String of error message.
- returns: An initialized `RequiredRule` object, or nil if an object could not be created for some reason that would not result in an exception.
*/
From ecb11dfa099674b079051f11606321d3dad54b37 Mon Sep 17 00:00:00 2001
From: David Patterson
Date: Fri, 15 Apr 2016 17:16:02 -0500
Subject: [PATCH 2/3] updated docs to reflect current codebase fixes #102
---
SwiftValidator/Rules/AlphaRule.swift | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/SwiftValidator/Rules/AlphaRule.swift b/SwiftValidator/Rules/AlphaRule.swift
index 95158d4..963ea8c 100644
--- a/SwiftValidator/Rules/AlphaRule.swift
+++ b/SwiftValidator/Rules/AlphaRule.swift
@@ -18,7 +18,7 @@ public class AlphaRule: CharacterSetRule {
Initializes an `AlphaRule` object to verify that a field has valid set of alpha characters.
- parameter message: String of 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.
+ - returns: An initialized object, or nil if an object could not be created for some reason.
*/
public init(message: String = "Enter valid alphabetic characters") {
super.init(characterSet: NSCharacterSet.letterCharacterSet(), message: message)
From 73842b06284a4d74eeed7a3f56261e868ec620ee Mon Sep 17 00:00:00 2001
From: David Patterson
Date: Fri, 15 Apr 2016 17:17:59 -0500
Subject: [PATCH 3/3] updated docs to reflect current codebase fixes #102
---
docs/Classes.html | 214 ++++++++++++-
docs/Classes/AlphaNumericRule.html | 192 ++++++++++++
docs/Classes/AlphaRule.html | 192 ++++++++++++
docs/Classes/CharacterSetRule.html | 288 ++++++++++++++++++
docs/Classes/ConfirmationRule.html | 20 +-
docs/Classes/EmailRule.html | 20 +-
docs/Classes/ExactLengthRule.html | 20 +-
docs/Classes/FloatRule.html | 20 +-
docs/Classes/FullNameRule.html | 20 +-
docs/Classes/HexColorRule.html | 191 ++++++++++++
docs/Classes/IPV4Rule.html | 191 ++++++++++++
docs/Classes/ISBNRule.html | 275 +++++++++++++++++
docs/Classes/MaxLengthRule.html | 25 +-
docs/Classes/MinLengthRule.html | 25 +-
docs/Classes/PasswordRule.html | 20 +-
docs/Classes/PhoneNumberRule.html | 24 +-
docs/Classes/RegexRule.html | 20 +-
docs/Classes/RequiredRule.html | 23 +-
docs/Classes/ValidationError.html | 31 +-
docs/Classes/ValidationRule.html | 20 +-
docs/Classes/Validator.html | 24 +-
docs/Classes/ZipCodeRule.html | 20 +-
docs/Protocols.html | 20 +-
docs/Protocols/Rule.html | 20 +-
docs/Protocols/ValidationDelegate.html | 26 +-
.../Contents/Resources/Documents/Classes.html | 214 ++++++++++++-
.../Documents/Classes/AlphaNumericRule.html | 192 ++++++++++++
.../Documents/Classes/AlphaRule.html | 192 ++++++++++++
.../Documents/Classes/CharacterSetRule.html | 288 ++++++++++++++++++
.../Documents/Classes/ConfirmationRule.html | 20 +-
.../Documents/Classes/EmailRule.html | 20 +-
.../Documents/Classes/ExactLengthRule.html | 20 +-
.../Documents/Classes/FloatRule.html | 20 +-
.../Documents/Classes/FullNameRule.html | 20 +-
.../Documents/Classes/HexColorRule.html | 191 ++++++++++++
.../Resources/Documents/Classes/IPV4Rule.html | 191 ++++++++++++
.../Resources/Documents/Classes/ISBNRule.html | 275 +++++++++++++++++
.../Documents/Classes/MaxLengthRule.html | 25 +-
.../Documents/Classes/MinLengthRule.html | 25 +-
.../Documents/Classes/PasswordRule.html | 20 +-
.../Documents/Classes/PhoneNumberRule.html | 24 +-
.../Documents/Classes/RegexRule.html | 20 +-
.../Documents/Classes/RequiredRule.html | 23 +-
.../Documents/Classes/ValidationError.html | 31 +-
.../Documents/Classes/ValidationRule.html | 20 +-
.../Documents/Classes/Validator.html | 24 +-
.../Documents/Classes/ZipCodeRule.html | 20 +-
.../Resources/Documents/Protocols.html | 20 +-
.../Resources/Documents/Protocols/Rule.html | 20 +-
.../Protocols/ValidationDelegate.html | 26 +-
.../Contents/Resources/Documents/index.html | 27 +-
.../Contents/Resources/docSet.dsidx | Bin 28672 -> 36864 bytes
docs/docsets/SwiftValidator.tgz | Bin 57780 -> 61135 bytes
docs/index.html | 27 +-
54 files changed, 3836 insertions(+), 100 deletions(-)
create mode 100644 docs/Classes/AlphaNumericRule.html
create mode 100644 docs/Classes/AlphaRule.html
create mode 100644 docs/Classes/CharacterSetRule.html
create mode 100644 docs/Classes/HexColorRule.html
create mode 100644 docs/Classes/IPV4Rule.html
create mode 100644 docs/Classes/ISBNRule.html
create mode 100644 docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/AlphaNumericRule.html
create mode 100644 docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/AlphaRule.html
create mode 100644 docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/CharacterSetRule.html
create mode 100644 docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/HexColorRule.html
create mode 100644 docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/IPV4Rule.html
create mode 100644 docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/ISBNRule.html
diff --git a/docs/Classes.html b/docs/Classes.html
index 57ca096..8b7f89c 100644
--- a/docs/Classes.html
+++ b/docs/Classes.html
@@ -29,6 +29,15 @@
Initializes a MaxLengthRule object that is to validate the length of the text of a text field
-- parameter length: Maximum character length.
-- parameter message: String of 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.
+
Initializes a MaxLengthRule object that is to validate the length of the text of a text field.
Initializes a MaxLengthRule object that is to validate the length of the text of a text field
-- parameter length: Minimum character length.
-- parameter message: String of error message.
-- returns: An initialized MinLengthRule object, or nil if an object could not be created for some reason that would not result in an exception.
+
Initializes a MaxLengthRule object that is to validate the length of the text of a text field.
Method used to initialize PhoneNumberRule object.
-- parameter message: Error message that is displayed if validation fails.
-- returns: An initialized PasswordRule object, or nil if an object could not be created for some reason that would not result in an exception.
+
Initializes a PhoneNumberRule object. Used to validate that a field has a valid phone number.
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.
+
Initializes ValidationError object with a textField and error.
@@ -268,11 +283,7 @@
-
Initializes ValidationError object with a textField, errorLabel, and errorMessage.
-- parameter textField: UITextField that holds textField.
-- parameter errorLabel: UILabel that holds error label.
-- 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.
+
Initializes ValidationError object with a textField, errorLabel, and errorMessage.
This method is used to validate a single field registered to Validator. If validation is unsuccessful,
-field gets added to errors dictionary.
-- parameter textField: Holds validator field data.
-- returns: No return value.
+field gets added to errors dictionary.
@@ -618,7 +634,7 @@ field gets added to errors dictionary.
-
Initializes a MaxLengthRule object that is to validate the length of the text of a text field
-- parameter length: Maximum character length.
-- parameter message: String of 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.
+
Initializes a MaxLengthRule object that is to validate the length of the text of a text field.
Initializes a MaxLengthRule object that is to validate the length of the text of a text field
-- parameter length: Minimum character length.
-- parameter message: String of error message.
-- returns: An initialized MinLengthRule object, or nil if an object could not be created for some reason that would not result in an exception.
+
Initializes a MaxLengthRule object that is to validate the length of the text of a text field.
Method used to initialize PhoneNumberRule object.
-- parameter message: Error message that is displayed if validation fails.
-- returns: An initialized PasswordRule object, or nil if an object could not be created for some reason that would not result in an exception.
+
Initializes a PhoneNumberRule object. Used to validate that a field has a valid phone number.
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.
+
Initializes ValidationError object with a textField and error.
@@ -268,11 +283,7 @@
-
Initializes ValidationError object with a textField, errorLabel, and errorMessage.
-- parameter textField: UITextField that holds textField.
-- parameter errorLabel: UILabel that holds error label.
-- 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.
+
Initializes ValidationError object with a textField, errorLabel, and errorMessage.
This method is used to validate a single field registered to Validator. If validation is unsuccessful,
-field gets added to errors dictionary.
-- parameter textField: Holds validator field data.
-- returns: No return value.
+field gets added to errors dictionary.
@@ -618,7 +634,7 @@ field gets added to errors dictionary.
-