diff --git a/SwiftValidator/Rules/IntegerRule.swift b/SwiftValidator/Rules/IntegerRule.swift new file mode 100644 index 0000000..d6452f5 --- /dev/null +++ b/SwiftValidator/Rules/IntegerRule.swift @@ -0,0 +1,52 @@ +// +// IntegerRule.swift +// Validator +// +// Created by rajatjain4061 on 29/06/17. +// Copyright © 2017 jpotts18. All rights reserved. +// + +import Foundation + +/** + `IntegerRule` is a subclass of Rule that is used to make sure a the text of a field is an integer. + */ +public class IntegerRule : Rule { + + /// Error message to be displayed if validation fails. + private var message : String + + /** + Initializes a `IntegerRule` object to validate that the text of a field is only Integer. + + - 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 = "This must be a number without a decimal"){ + 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 { + let regex = try? NSRegularExpression(pattern: "^[0-9]+$", options: []) + if let regex = regex { + let match = regex.numberOfMatches(in: value, options: [], range: NSRange(location: 0, length: value.characters.count)) + return match == 1 + } + return false + } + + /** + Displays error message when field fails validation. + + - returns: String of error message. + */ + public func errorMessage() -> String { + return message + } +} diff --git a/SwiftValidator/Rules/RegexRule.swift b/SwiftValidator/Rules/RegexRule.swift index 697c626..5b500ea 100644 --- a/SwiftValidator/Rules/RegexRule.swift +++ b/SwiftValidator/Rules/RegexRule.swift @@ -11,7 +11,7 @@ import Foundation /** `RegexRule` is a subclass of Rule that defines how a regular expression is validated. */ -public class RegexRule : Rule { +open class RegexRule : Rule { /// Regular express string to be used in validation. private var REGEX: String = "^(?=.*?[A-Z]).{8,}$" /// String that holds error message. diff --git a/SwiftValidatorTests/SwiftValidatorTests.swift b/SwiftValidatorTests/SwiftValidatorTests.swift index fab19bc..06899d5 100644 --- a/SwiftValidatorTests/SwiftValidatorTests.swift +++ b/SwiftValidatorTests/SwiftValidatorTests.swift @@ -31,6 +31,9 @@ class SwiftValidatorTests: XCTestCase { let VALID_FLOAT = "1234.444" let INVALID_FLOAT = "1234.44.44" + let VALID_INTEGER = "12345" + let INVALID_INTEGER = "abcd1234" + let LEN_3 = "hey" let LEN_5 = "Howdy" let LEN_20 = "Paint the cat orange" @@ -129,6 +132,21 @@ class SwiftValidatorTests: XCTestCase { XCTAssertNotNil(FloatRule().errorMessage()) } + // MARK: Integer + + func testInteger() { + XCTAssert(IntegerRule().validate(VALID_INTEGER), "Integer should be valid") + } + + func testIntegerInvalid() { + XCTAssert(!IntegerRule().validate(INVALID_INTEGER), "Integer should be invalid") + XCTAssert(!IntegerRule().validate(VALID_EMAIL), "Integer should be invalid") + } + + func testIntegerMessage() { + XCTAssertNotNil(IntegerRule().errorMessage()) + } + // MARK: Confirm against field func testConfirmSame(){ diff --git a/Validator.xcodeproj/project.pbxproj b/Validator.xcodeproj/project.pbxproj index 17b420c..85fbe54 100644 --- a/Validator.xcodeproj/project.pbxproj +++ b/Validator.xcodeproj/project.pbxproj @@ -19,6 +19,7 @@ 7CC1E4D51C637C8500AF013C /* IPV4Rule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CC1E4D41C637C8500AF013C /* IPV4Rule.swift */; }; 7CC1E4D71C637F6E00AF013C /* ISBNRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CC1E4D61C637F6E00AF013C /* ISBNRule.swift */; }; 7CC1E4DB1C63BFA600AF013C /* HexColorRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CC1E4DA1C63BFA600AF013C /* HexColorRule.swift */; }; + CE11CAA51F04D27B009BB9C5 /* IntegerRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE11CAA41F04D27B009BB9C5 /* IntegerRule.swift */; }; FB465CB81B9884F400398388 /* SwiftValidator.h in Headers */ = {isa = PBXBuildFile; fileRef = FB465CB71B9884F400398388 /* SwiftValidator.h */; settings = {ATTRIBUTES = (Public, ); }; }; FB465CBE1B9884F400398388 /* SwiftValidator.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB465CB31B9884F400398388 /* SwiftValidator.framework */; }; FB465CC71B9884F400398388 /* SwiftValidatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB465CC61B9884F400398388 /* SwiftValidatorTests.swift */; }; @@ -107,6 +108,7 @@ 7CC1E4D41C637C8500AF013C /* IPV4Rule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IPV4Rule.swift; sourceTree = ""; }; 7CC1E4D61C637F6E00AF013C /* ISBNRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ISBNRule.swift; sourceTree = ""; }; 7CC1E4DA1C63BFA600AF013C /* HexColorRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HexColorRule.swift; sourceTree = ""; }; + CE11CAA41F04D27B009BB9C5 /* IntegerRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IntegerRule.swift; sourceTree = ""; }; FB465CB31B9884F400398388 /* SwiftValidator.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftValidator.framework; sourceTree = BUILT_PRODUCTS_DIR; }; FB465CB61B9884F400398388 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; FB465CB71B9884F400398388 /* SwiftValidator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SwiftValidator.h; sourceTree = ""; }; @@ -284,6 +286,7 @@ FB465CEE1B9889EA00398388 /* ValidationRule.swift */, FB465CEF1B9889EA00398388 /* ZipCodeRule.swift */, 62C1821C1C6312F5003788E7 /* ExactLengthRule.swift */, + CE11CAA41F04D27B009BB9C5 /* IntegerRule.swift */, ); path = Rules; sourceTree = ""; @@ -515,6 +518,7 @@ FB465D001B9889EA00398388 /* ValidationError.swift in Sources */, FB465CFC1B9889EA00398388 /* RequiredRule.swift in Sources */, FB465CFB1B9889EA00398388 /* RegexRule.swift in Sources */, + CE11CAA51F04D27B009BB9C5 /* IntegerRule.swift in Sources */, 7CC1E4CF1C636B4500AF013C /* AlphaRule.swift in Sources */, 62D9B2561C7C0B2A00BAFCE3 /* ValidationDelegate.swift in Sources */, FB465CF81B9889EA00398388 /* MinLengthRule.swift in Sources */, diff --git a/Validator.xcodeproj/xcshareddata/xcschemes/Validator.xcscheme b/Validator.xcodeproj/xcshareddata/xcschemes/Validator.xcscheme index e9d5ba4..31fb0df 100644 --- a/Validator.xcodeproj/xcshareddata/xcschemes/Validator.xcscheme +++ b/Validator.xcodeproj/xcshareddata/xcschemes/Validator.xcscheme @@ -26,7 +26,8 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - shouldUseLaunchSchemeArgsEnv = "YES"> + shouldUseLaunchSchemeArgsEnv = "YES" + codeCoverageEnabled = "YES"> diff --git a/docs/Classes.html b/docs/Classes.html index 8b7f89c..0e4a174 100644 --- a/docs/Classes.html +++ b/docs/Classes.html @@ -13,7 +13,7 @@
-

SwiftValidator Docs (100% documented)

+

SwiftValidator Docs (92% documented)

@@ -62,6 +62,9 @@ + @@ -94,17 +97,36 @@ + +
@@ -138,7 +160,7 @@

Classes

Declaration

Swift

-
public class EmailRule: RegexRule
+
public class EmailRule: RegexRule
@@ -170,7 +192,7 @@

Declaration

Declaration

Swift

-
public class FullNameRule : Rule
+
public class FullNameRule : Rule
@@ -202,7 +224,7 @@

Declaration

Declaration

Swift

-
public class ZipCodeRule: RegexRule
+
public class ZipCodeRule: RegexRule
@@ -234,7 +256,7 @@

Declaration

Declaration

Swift

-
public class PasswordRule : RegexRule
+
public class PasswordRule : RegexRule
@@ -267,7 +289,7 @@

Declaration

Declaration

Swift

-
public class AlphaNumericRule: CharacterSetRule
+
public class AlphaNumericRule: CharacterSetRule
@@ -299,7 +321,7 @@

Declaration

Declaration

Swift

-
public class CharacterSetRule: Rule
+
public class CharacterSetRule: Rule
@@ -331,7 +353,7 @@

Declaration

Declaration

Swift

-
public class PhoneNumberRule: RegexRule
+
public class PhoneNumberRule: RegexRule
@@ -363,7 +385,7 @@

Declaration

Declaration

Swift

-
public class FloatRule:Rule
+
public class FloatRule:Rule
@@ -395,7 +417,7 @@

Declaration

Declaration

Swift

-
public class HexColorRule: RegexRule
+
public class HexColorRule: RegexRule
@@ -452,7 +474,7 @@

Declaration

-

ValidationRule is a class that creates an object which holds validation info of a text field.

+

ValidationRule is a class that creates an object which holds validation info of a field.

See more
@@ -484,8 +506,8 @@

Declaration

-

ConfirmationRule is a subclass of Rule that defines how a text field that has to be equal -to another text field is validated.

+

ConfirmationRule is a subclass of Rule that defines how a field that has to be equal +to another field is validated.

See more
@@ -493,7 +515,7 @@

Declaration

Declaration

Swift

-
public class ConfirmationRule: Rule
+
public class ConfirmationRule: Rule
@@ -525,7 +547,7 @@

Declaration

Declaration

Swift

-
public class IPV4Rule: RegexRule
+
public class IPV4Rule: RegexRule
@@ -557,7 +579,7 @@

Declaration

Declaration

Swift

-
public class ISBNRule: Rule
+
public class ISBNRule: Rule
@@ -581,7 +603,7 @@

Declaration

-

The ValidationError class is used for representing errors of a failed validation. It contains the text field, error label, and error message of a failed validation.

+

The ValidationError class is used for representing errors of a failed validation. It contains the field, error label, and error message of a failed validation.

See more
@@ -613,7 +635,7 @@

Declaration

-

RequiredRule is a subclass of Rule that defines how a required text field is validated.

+

RequiredRule is a subclass of Rule that defines how a required field is validated.

See more
@@ -621,7 +643,7 @@

Declaration

Declaration

Swift

-
public class RequiredRule: Rule
+
public class RequiredRule: Rule
@@ -653,7 +675,39 @@

Declaration

Declaration

Swift

-
public class RegexRule : Rule
+
open class RegexRule : Rule
+ +
+ +
+ + + + +
+
    +
  • +
    + + + + IntegerRule + +
    +
    +
    +
    +
    +
    +

    IntegerRule is a subclass of Rule that is used to make sure a the text of a field is an integer.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public class IntegerRule : Rule
    @@ -686,7 +740,7 @@

    Declaration

    Declaration

    Swift

    -
    public class AlphaRule: CharacterSetRule
    +
    public class AlphaRule: CharacterSetRule
    @@ -718,7 +772,7 @@

    Declaration

    Declaration

    Swift

    -
    public class MinLengthRule: Rule
    +
    public class MinLengthRule: Rule
@@ -750,7 +804,7 @@

Declaration

Declaration

Swift

-
public class MaxLengthRule: Rule
+
public class MaxLengthRule: Rule
@@ -774,7 +828,7 @@

Declaration

-

ExactLengthRule is a subclass of Rule that is used to make sure a the text of a text field is an exact length.

+

ExactLengthRule is a subclass of Rule that is used to make sure a the text of a field is an exact length.

See more
@@ -782,7 +836,7 @@

Declaration

Declaration

Swift

-
public class ExactLengthRule : Rule
+
public class ExactLengthRule : Rule
@@ -794,8 +848,8 @@

Declaration

diff --git a/docs/Classes/AlphaNumericRule.html b/docs/Classes/AlphaNumericRule.html index 8b7d92d..51df38b 100644 --- a/docs/Classes/AlphaNumericRule.html +++ b/docs/Classes/AlphaNumericRule.html @@ -14,7 +14,7 @@
-

SwiftValidator Docs (100% documented)

+

SwiftValidator Docs (92% documented)

@@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
@@ -114,7 +136,7 @@

AlphaNumericRule

-
public class AlphaNumericRule: CharacterSetRule
+
public class AlphaNumericRule: CharacterSetRule
@@ -128,9 +150,9 @@

AlphaNumericRule

  • @@ -138,7 +160,7 @@

    AlphaNumericRule

    -

    Initializes a AlphaNumericRule object to verify that field has valid set of alphanumeric characters.

    +

    Initializes a AlphaNumericRule object to verify that field has valid set of alphanumeric characters.

    @@ -162,7 +184,6 @@

    Parameters

    String of error message.

    -
    @@ -172,7 +193,6 @@

    Parameters

    Return Value

    An initialized object, or nil if an object could not be created for some reason that would not result in an exception.

    -
    @@ -182,8 +202,8 @@

    Return Value

  • diff --git a/docs/Classes/AlphaRule.html b/docs/Classes/AlphaRule.html index 71f1d81..bcc184e 100644 --- a/docs/Classes/AlphaRule.html +++ b/docs/Classes/AlphaRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,7 +136,7 @@

    AlphaRule

    -
    public class AlphaRule: CharacterSetRule
    +
    public class AlphaRule: CharacterSetRule
    @@ -128,9 +150,9 @@

    AlphaRule

  • @@ -138,7 +160,7 @@

    AlphaRule

    -

    Initializes an AlphaRule object to verify that a field has valid set of alpha characters.

    +

    Initializes an AlphaRule object to verify that a field has valid set of alpha characters.

    @@ -162,7 +184,6 @@

    Parameters

    String of error message.

    -
    @@ -172,7 +193,6 @@

    Parameters

    Return Value

    An initialized object, or nil if an object could not be created for some reason.

    -
    @@ -182,8 +202,8 @@

    Return Value

  • diff --git a/docs/Classes/CharacterSetRule.html b/docs/Classes/CharacterSetRule.html index c472ede..1616fab 100644 --- a/docs/Classes/CharacterSetRule.html +++ b/docs/Classes/CharacterSetRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,7 +136,7 @@

    CharacterSetRule

    -
    public class CharacterSetRule: Rule
    +
    public class CharacterSetRule: Rule
    @@ -127,9 +149,9 @@

    CharacterSetRule

  • @@ -137,14 +159,14 @@

    CharacterSetRule

    -

    Initializes a CharacterSetRule object to verify that field has valid set of characters.

    +

    Initializes a CharacterSetRule object to verify that field has valid set of characters.

    Declaration

    Swift

    -
    public init(characterSet: NSCharacterSet, message: String = "Enter valid alpha")
    +
    public init(characterSet: CharacterSet, message: String = "Enter valid alpha")
    @@ -161,7 +183,6 @@

    Parameters

    NSCharacterSet that holds group of valid characters.

    -
    @@ -174,7 +195,6 @@

    Parameters

    String of error message.

    -
    @@ -184,7 +204,6 @@

    Parameters

    Return Value

    An initialized object, or nil if an object could not be created for some reason that would not result in an exception.

    -
    @@ -192,9 +211,9 @@

    Return Value

  • @@ -209,7 +228,7 @@

    Return Value

    Declaration

    Swift

    -
    public func validate(value: String) -> Bool
    +
    public func validate(_ value: String) -> Bool
    @@ -226,7 +245,6 @@

    Parameters

    String to checked for validation.

    -
    @@ -236,7 +254,6 @@

    Parameters

    Return Value

    Boolean value. True if validation is successful; False if validation fails.

    -
  • @@ -244,9 +261,9 @@

    Return Value

  • @@ -254,7 +271,7 @@

    Return Value

    -

    Displays error message when text field fails validation.

    +

    Displays error message when field fails validation.

    @@ -268,7 +285,6 @@

    Declaration

    Return Value

    String of error message.

    -
    @@ -278,8 +294,8 @@

    Return Value

    diff --git a/docs/Classes/ConfirmationRule.html b/docs/Classes/ConfirmationRule.html index 265e6c1..2c7419a 100644 --- a/docs/Classes/ConfirmationRule.html +++ b/docs/Classes/ConfirmationRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@
  • + @@ -95,17 +98,36 @@ + +
    @@ -114,12 +136,12 @@

    ConfirmationRule

    -
    public class ConfirmationRule: Rule
    +
    public class ConfirmationRule: Rule
    -

    ConfirmationRule is a subclass of Rule that defines how a text field that has to be equal -to another text field is validated.

    +

    ConfirmationRule is a subclass of Rule that defines how a field that has to be equal +to another field is validated.

    @@ -128,9 +150,9 @@

    ConfirmationRule

  • @@ -138,14 +160,14 @@

    ConfirmationRule

    -

    Initializes a ConfirmationRule object to validate the text of a text field that should equal the text of another text field.

    +

    Initializes a ConfirmationRule object to validate the text of a field that should equal the text of another field.

    Declaration

    Swift

    -
    public init(confirmField: UITextField, message : String = "This field does not match")
    +
    public init(confirmField: ValidatableField, message : String = "This field does not match")
    @@ -161,8 +183,7 @@

    Parameters

    -

    text field to which original text field will be compared to.

    - +

    field to which original field will be compared to.

    @@ -175,7 +196,6 @@

    Parameters

    String of error message.

    -
    @@ -185,7 +205,6 @@

    Parameters

    Return Value

    An initialized object, or nil if an object could not be created for some reason that would not result in an exception.

    -
    @@ -193,9 +212,9 @@

    Return Value

  • @@ -203,14 +222,14 @@

    Return Value

    -

    Used to validate a text field.

    +

    Used to validate a field.

    Declaration

    Swift

    -
    public func validate(value: String) -> Bool
    +
    public func validate(_ value: String) -> Bool
    @@ -227,7 +246,6 @@

    Parameters

    String to checked for validation.

    -
    @@ -237,7 +255,6 @@

    Parameters

    Return Value

    A boolean value. True if validation is successful; False if validation fails.

    -
    @@ -245,9 +262,9 @@

    Return Value

  • @@ -269,7 +286,6 @@

    Declaration

    Return Value

    String of error message.

    -
  • @@ -279,8 +295,8 @@

    Return Value

    diff --git a/docs/Classes/EmailRule.html b/docs/Classes/EmailRule.html index 7e29119..f387900 100644 --- a/docs/Classes/EmailRule.html +++ b/docs/Classes/EmailRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,7 +136,7 @@

    EmailRule

    -
    public class EmailRule: RegexRule
    +
    public class EmailRule: RegexRule
    @@ -127,9 +149,9 @@

    EmailRule

  • @@ -137,7 +159,7 @@

    EmailRule

    -

    Initializes an EmailRule object to validate an email text field.

    +

    Initializes an EmailRule object to validate an email field.

    @@ -161,7 +183,6 @@

    Parameters

    String of error message.

    -
    @@ -171,7 +192,6 @@

    Parameters

    Return Value

    An initialized object, or nil if an object could not be created for some reason that would not result in an exception.

    -
    @@ -181,8 +201,8 @@

    Return Value

  • diff --git a/docs/Classes/ExactLengthRule.html b/docs/Classes/ExactLengthRule.html index d17e840..855723b 100644 --- a/docs/Classes/ExactLengthRule.html +++ b/docs/Classes/ExactLengthRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,11 +136,11 @@

    ExactLengthRule

    -
    public class ExactLengthRule : Rule
    +
    public class ExactLengthRule : Rule
    -

    ExactLengthRule is a subclass of Rule that is used to make sure a the text of a text field is an exact length.

    +

    ExactLengthRule is a subclass of Rule that is used to make sure a the text of a field is an exact length.

    @@ -127,9 +149,9 @@

    ExactLengthRule

  • @@ -137,7 +159,7 @@

    ExactLengthRule

    -

    Initializes an ExactLengthRule object to validate the text of a text field against an exact length.

    +

    Initializes an ExactLengthRule object to validate the text of a field against an exact length.

    @@ -161,7 +183,6 @@

    Parameters

    Integer value of exact string length being specified.

    -
    @@ -174,7 +195,6 @@

    Parameters

    String of error message.

    -
    @@ -183,8 +203,7 @@

    Parameters

    Return Value

    -

    An initialized ExactLengthRule object, or nil if an object could not be created for some reason. that would not result in an exception.

    - +

    An initialized ExactLengthRule object, or nil if an object could not be created for some reason. that would not result in an exception.

    @@ -192,9 +211,9 @@

    Return Value

  • @@ -202,14 +221,14 @@

    Return Value

    -

    Used to validate a text field.

    +

    Used to validate a field.

    Declaration

    Swift

    -
    public func validate(value: String) -> Bool
    +
    public func validate(_ value: String) -> Bool
    @@ -226,7 +245,6 @@

    Parameters

    String to checked for validation.

    -
    @@ -236,7 +254,6 @@

    Parameters

    Return Value

    A boolean value. True if validation is successful; False if validation fails.

    -
    @@ -244,9 +261,9 @@

    Return Value

  • @@ -254,7 +271,7 @@

    Return Value

    -

    Displays error message if a text field fails validation.

    +

    Displays error message if a field fails validation.

    @@ -268,7 +285,6 @@

    Declaration

    Return Value

    String of error message.

    -
    @@ -278,8 +294,8 @@

    Return Value

  • diff --git a/docs/Classes/FloatRule.html b/docs/Classes/FloatRule.html index 98a6226..491abe0 100644 --- a/docs/Classes/FloatRule.html +++ b/docs/Classes/FloatRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,7 +136,7 @@

    FloatRule

    -
    public class FloatRule:Rule
    +
    public class FloatRule:Rule
    @@ -127,9 +149,9 @@

    FloatRule

  • @@ -137,7 +159,7 @@

    FloatRule

    -

    Initializes a FloatRule object to validate that the text of a text field is a floating point number.

    +

    Initializes a FloatRule object to validate that the text of a field is a floating point number.

    @@ -161,7 +183,6 @@

    Parameters

    String of error message.

    -
    @@ -171,7 +192,6 @@

    Parameters

    Return Value

    An initialized object, or nil if an object could not be created for some reason that would not result in an exception.

    -
    @@ -179,9 +199,9 @@

    Return Value

  • @@ -189,14 +209,14 @@

    Return Value

    -

    Used to validate text field.

    +

    Used to validate field.

    Declaration

    Swift

    -
    public func validate(value: String) -> Bool
    +
    public func validate(_ value: String) -> Bool
    @@ -213,7 +233,6 @@

    Parameters

    String to checked for validation.

    -
    @@ -223,7 +242,6 @@

    Parameters

    Return Value

    Boolean value. True if validation is successful; False if validation fails.

    -
    @@ -231,9 +249,9 @@

    Return Value

  • @@ -241,7 +259,7 @@

    Return Value

    -

    Displays error message when text field fails validation.

    +

    Displays error message when field fails validation.

    @@ -255,7 +273,6 @@

    Declaration

    Return Value

    String of error message.

    -
    @@ -265,8 +282,8 @@

    Return Value

  • diff --git a/docs/Classes/FullNameRule.html b/docs/Classes/FullNameRule.html index 116bc21..91d3e97 100644 --- a/docs/Classes/FullNameRule.html +++ b/docs/Classes/FullNameRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,7 +136,7 @@

    FullNameRule

    -
    public class FullNameRule : Rule
    +
    public class FullNameRule : Rule
    @@ -127,9 +149,9 @@

    FullNameRule

  • @@ -137,7 +159,7 @@

    FullNameRule

    -

    Initializes a FullNameRule object that is used to verify that text in text field is a full name.

    +

    Initializes a FullNameRule object that is used to verify that text in field is a full name.

    @@ -161,7 +183,6 @@

    Parameters

    String of error message.

    -
    @@ -170,8 +191,7 @@

    Parameters

    Return Value

    -

    An initialized FullNameRule object, or nil if an object could not be created for some reason that would not result in an exception.

    - +

    An initialized FullNameRule object, or nil if an object could not be created for some reason that would not result in an exception.

    @@ -179,9 +199,9 @@

    Return Value

  • @@ -189,14 +209,14 @@

    Return Value

    -

    Used to validate a text field.

    +

    Used to validate a field.

    Declaration

    Swift

    -
    public func validate(value: String) -> Bool
    +
    public func validate(_ value: String) -> Bool
    @@ -213,7 +233,6 @@

    Parameters

    String to checked for validation.

    -
    @@ -223,7 +242,6 @@

    Parameters

    Return Value

    A boolean value. True if validation is successful; False if validation fails.

    -
    @@ -231,9 +249,9 @@

    Return Value

  • @@ -241,7 +259,7 @@

    Return Value

    -

    Used to display error message of a text field that has failed validation.

    +

    Used to display error message of a field that has failed validation.

    @@ -255,7 +273,6 @@

    Declaration

    Return Value

    String of error message.

    -
    @@ -265,8 +282,8 @@

    Return Value

  • diff --git a/docs/Classes/HexColorRule.html b/docs/Classes/HexColorRule.html index 093b195..e294df9 100644 --- a/docs/Classes/HexColorRule.html +++ b/docs/Classes/HexColorRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,7 +136,7 @@

    HexColorRule

    -
    public class HexColorRule: RegexRule
    +
    public class HexColorRule: RegexRule
    @@ -127,9 +149,9 @@

    HexColorRule

  • @@ -161,7 +183,6 @@

    Parameters

    String of error message.

    -
    @@ -171,7 +192,6 @@

    Parameters

    Return Value

    An initialized object, or nil if an object could not be created for some reason that would not result in an exception.

    -
    @@ -181,8 +201,8 @@

    Return Value

  • diff --git a/docs/Classes/IPV4Rule.html b/docs/Classes/IPV4Rule.html index 09db4c8..69a662d 100644 --- a/docs/Classes/IPV4Rule.html +++ b/docs/Classes/IPV4Rule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,7 +136,7 @@

    IPV4Rule

    -
    public class IPV4Rule: RegexRule
    +
    public class IPV4Rule: RegexRule
    @@ -127,9 +149,9 @@

    IPV4Rule

  • @@ -137,7 +159,7 @@

    IPV4Rule

    -

    Initializes a IPV4Rule object to verify that field has text is an IPV4Rule address.

    +

    Initializes a IPV4Rule object to verify that field has text is an IPV4Rule address.

    @@ -161,7 +183,6 @@

    Parameters

    String of error message.

    -
    @@ -171,7 +192,6 @@

    Parameters

    Return Value

    An initialized object, or nil if an object could not be created for some reason that would not result in an exception.

    -
    @@ -181,8 +201,8 @@

    Return Value

  • diff --git a/docs/Classes/ISBNRule.html b/docs/Classes/ISBNRule.html index 8a84450..b289b4c 100644 --- a/docs/Classes/ISBNRule.html +++ b/docs/Classes/ISBNRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,7 +136,7 @@

    ISBNRule

    -
    public class ISBNRule: Rule
    +
    public class ISBNRule: Rule
    @@ -127,9 +149,9 @@

    ISBNRule

  • @@ -137,7 +159,7 @@

    ISBNRule

    -

    Initializes a ISBNRule object to verify that field has text that is a ISBN number.

    +

    Initializes a ISBNRule object to verify that field has text that is a ISBN number.

    @@ -161,7 +183,6 @@

    Parameters

    String of error message.

    -
    @@ -171,7 +192,6 @@

    Parameters

    Return Value

    An initialized object, or nil if an object could not be created for some reason that would not result in an exception.

    -
    @@ -179,9 +199,9 @@

    Return Value

  • @@ -189,14 +209,14 @@

    Return Value

    -

    Method used to validate text field.

    +

    Method used to validate field.

    Declaration

    Swift

    -
    public func validate(value: String) -> Bool
    +
    public func validate(_ value: String) -> Bool
    @@ -213,7 +233,6 @@

    Parameters

    String to checked for validation.

    -
    @@ -223,7 +242,6 @@

    Parameters

    Return Value

    Boolean value. True if validation is successful; False if validation fails.

    -
    @@ -231,9 +249,9 @@

    Return Value

  • @@ -241,7 +259,7 @@

    Return Value

    -

    Method used to dispaly error message when text field fails validation.

    +

    Method used to dispaly error message when field fails validation.

    @@ -255,7 +273,6 @@

    Declaration

    Return Value

    String of error message.

    -
    @@ -265,8 +282,8 @@

    Return Value

  • diff --git a/docs/Classes/IntegerRule.html b/docs/Classes/IntegerRule.html new file mode 100644 index 0000000..4d95b21 --- /dev/null +++ b/docs/Classes/IntegerRule.html @@ -0,0 +1,292 @@ + + + + IntegerRule Class Reference + + + + + + + + + + +
    +
    +

    SwiftValidator Docs (92% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    IntegerRule

    +
    +
    +
    public class IntegerRule : Rule
    + +
    +
    +

    IntegerRule is a subclass of Rule that is used to make sure a the text of a field is an integer.

    + +
    +
    +
    +
      +
    • +
      + + + + init(message:) + +
      +
      +
      +
      +
      +
      +

      Initializes a IntegerRule object to validate that the text of a field is only Integer.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public init(message : String = "This must be a number without a decimal")
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + message + + +
      +

      String of error message.

      +
      +
      +
      +
      +

      Return Value

      +

      An initialized object, or nil if an object could not be created for some reason that would not result in an exception.

      +
      +
      +
      +
    • +
    • +
      + + + + validate(_:) + +
      +
      +
      +
      +
      +
      +

      Used to validate field.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public func validate(_ value: String) -> Bool
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + value + + +
      +

      String to checked for validation.

      +
      +
      +
      +
      +

      Return Value

      +

      Boolean value. True if validation is successful; False if validation fails.

      +
      +
      +
      +
    • +
    • +
      + + + + errorMessage() + +
      +
      +
      +
      +
      +
      +

      Displays error message when field fails validation.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public func errorMessage() -> String
      + +
      +
      +
      +

      Return Value

      +

      String of error message.

      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Classes/MaxLengthRule.html b/docs/Classes/MaxLengthRule.html index 0bf5abc..00a98dc 100644 --- a/docs/Classes/MaxLengthRule.html +++ b/docs/Classes/MaxLengthRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,7 +136,7 @@

    MaxLengthRule

    -
    public class MaxLengthRule: Rule
    +
    public class MaxLengthRule: Rule
    @@ -127,9 +149,9 @@

    MaxLengthRule

  • - + - init() + init()
    @@ -143,14 +165,13 @@

    MaxLengthRule

    Declaration

    Swift

    -
    public init(){}
    +
    public init()

    Return Value

    -

    An initialized MaxLengthRule object, or nil if an object could not be created for some reason that would not result in an exception.

    - +

    An initialized MaxLengthRule object, or nil if an object could not be created for some reason that would not result in an exception.

  • @@ -158,9 +179,9 @@

    Return Value

  • @@ -168,7 +189,7 @@

    Return Value

    -

    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 field.

    @@ -192,7 +213,6 @@

    Parameters

    Maximum character length.

    -
    @@ -205,7 +225,6 @@

    Parameters

    String of error message.

    -
    @@ -215,7 +234,6 @@

    Parameters

    Return Value

    An initialized object, or nil if an object could not be created for some reason that would not result in an exception.

    -
    @@ -223,9 +241,9 @@

    Return Value

  • @@ -233,14 +251,14 @@

    Return Value

    -

    Used to validate a text field.

    +

    Used to validate a field.

    Declaration

    Swift

    -
    public func validate(value: String) -> Bool
    +
    public func validate(_ value: String) -> Bool
    @@ -257,7 +275,6 @@

    Parameters

    String to checked for validation.

    -
    @@ -267,7 +284,6 @@

    Parameters

    Return Value

    A boolean value. True if validation is successful; False if validation fails.

    -
    @@ -275,9 +291,9 @@

    Return Value

  • @@ -285,7 +301,7 @@

    Return Value

    -

    Displays an error message if a text field fails validation.

    +

    Displays an error message if a field fails validation.

    @@ -299,7 +315,6 @@

    Declaration

    Return Value

    String of error message.

    -
    @@ -309,8 +324,8 @@

    Return Value

    diff --git a/docs/Classes/MinLengthRule.html b/docs/Classes/MinLengthRule.html index 62139db..c9bf55f 100644 --- a/docs/Classes/MinLengthRule.html +++ b/docs/Classes/MinLengthRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@
  • + @@ -95,17 +98,36 @@ + +
    @@ -114,7 +136,7 @@

    MinLengthRule

    -
    public class MinLengthRule: Rule
    +
    public class MinLengthRule: Rule
    @@ -127,9 +149,9 @@

    MinLengthRule

  • - + - init() + init()
    @@ -143,14 +165,13 @@

    MinLengthRule

    Declaration

    Swift

    -
    public init(){}
    +
    public init()

    Return Value

    -

    An initialized MinLengthRule object, or nil if an object could not be created for some reason that would not result in an exception.

    - +

    An initialized MinLengthRule object, or nil if an object could not be created for some reason that would not result in an exception.

    @@ -158,9 +179,9 @@

    Return Value

  • @@ -168,7 +189,7 @@

    Return Value

    -

    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 field.

    @@ -192,7 +213,6 @@

    Parameters

    Minimum character length.

    -
    @@ -205,7 +225,6 @@

    Parameters

    String of error message.

    -
    @@ -214,8 +233,7 @@

    Parameters

    Return Value

    -

    An initialized MinLengthRule object, or nil if an object could not be created for some reason that would not result in an exception.

    - +

    An initialized MinLengthRule object, or nil if an object could not be created for some reason that would not result in an exception.

    @@ -223,9 +241,9 @@

    Return Value

  • @@ -233,16 +251,14 @@

    Return Value

    -

    Validates a text field. -- parameter value: String to checked for validation. -- returns: A boolean value. True if validation is successful; False if validation fails.

    +

    Validates a field.

    Declaration

    Swift

    -
    public func validate(value: String) -> Bool
    +
    public func validate(_ value: String) -> Bool
    @@ -259,7 +275,6 @@

    Parameters

    String to checked for validation.

    -
    @@ -269,7 +284,6 @@

    Parameters

    Return Value

    A boolean value. True if validation is successful; False if validation fails.

    -
    @@ -277,9 +291,9 @@

    Return Value

  • @@ -287,7 +301,7 @@

    Return Value

    -

    Displays error message when text field has failed validation.

    +

    Displays error message when field has failed validation.

    @@ -301,7 +315,6 @@

    Declaration

    Return Value

    String of error message.

    -
    @@ -311,8 +324,8 @@

    Return Value

  • diff --git a/docs/Classes/PasswordRule.html b/docs/Classes/PasswordRule.html index d849535..35fa246 100644 --- a/docs/Classes/PasswordRule.html +++ b/docs/Classes/PasswordRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,7 +136,7 @@

    PasswordRule

    -
    public class PasswordRule : RegexRule
    +
    public class PasswordRule : RegexRule
    @@ -127,9 +149,9 @@

    PasswordRule

  • @@ -137,7 +159,7 @@

    PasswordRule

    -

    Initializes a PasswordRule object that will validate a text field is a valid password.

    +

    Initializes a PasswordRule object that will validate a field is a valid password.

    @@ -161,7 +183,6 @@

    Parameters

    String of error message.

    -
    @@ -170,8 +191,7 @@

    Parameters

    Return Value

    -

    An initialized PasswordRule object, or nil if an object could not be created for some reason that would not result in an exception.

    - +

    An initialized PasswordRule object, or nil if an object could not be created for some reason that would not result in an exception.

    @@ -181,8 +201,8 @@

    Return Value

  • diff --git a/docs/Classes/PhoneNumberRule.html b/docs/Classes/PhoneNumberRule.html index 3b8d9b5..da40d48 100644 --- a/docs/Classes/PhoneNumberRule.html +++ b/docs/Classes/PhoneNumberRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,7 +136,7 @@

    PhoneNumberRule

    -
    public class PhoneNumberRule: RegexRule
    +
    public class PhoneNumberRule: RegexRule
    @@ -127,9 +149,9 @@

    PhoneNumberRule

  • @@ -137,7 +159,7 @@

    PhoneNumberRule

    -

    Initializes a PhoneNumberRule object. Used to validate that a field has a valid phone number.

    +

    Initializes a PhoneNumberRule object. Used to validate that a field has a valid phone number.

    @@ -161,7 +183,6 @@

    Parameters

    Error message that is displayed if validation fails.

    -
    @@ -171,7 +192,6 @@

    Parameters

    Return Value

    An initialized PasswordRule object, or nil if an object could not be created for some reason that would not result in an exception.

    -
    @@ -181,8 +201,8 @@

    Return Value

  • diff --git a/docs/Classes/RegexRule.html b/docs/Classes/RegexRule.html index 2ec0ea8..b565c42 100644 --- a/docs/Classes/RegexRule.html +++ b/docs/Classes/RegexRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,7 +136,7 @@

    RegexRule

    -
    public class RegexRule : Rule
    +
    open class RegexRule : Rule
    @@ -127,9 +149,9 @@

    RegexRule

  • @@ -137,7 +159,7 @@

    RegexRule

    -

    Method used to initialize RegexRule object.

    +

    Method used to initialize RegexRule object.

    @@ -161,7 +183,6 @@

    Parameters

    Regular expression string to be used in validation.

    -
    @@ -174,7 +195,6 @@

    Parameters

    String of error message.

    -
    @@ -183,8 +203,7 @@

    Parameters

    Return Value

    -

    An initialized RegexRule object, or nil if an object could not be created for some reason that would not result in an exception.

    - +

    An initialized RegexRule object, or nil if an object could not be created for some reason that would not result in an exception.

    @@ -192,9 +211,9 @@

    Return Value

  • @@ -202,14 +221,14 @@

    Return Value

    -

    Method used to validate text field.

    +

    Method used to validate field.

    Declaration

    Swift

    -
    public func validate(value: String) -> Bool
    +
    public func validate(_ value: String) -> Bool
    @@ -226,7 +245,6 @@

    Parameters

    String to checked for validation.

    -
    @@ -236,7 +254,6 @@

    Parameters

    Return Value

    Boolean value. True if validation is successful; False if validation fails.

    -
    @@ -244,9 +261,9 @@

    Return Value

  • @@ -254,7 +271,7 @@

    Return Value

    -

    Method used to dispaly error message when text field fails validation.

    +

    Method used to dispaly error message when field fails validation.

    @@ -268,7 +285,6 @@

    Declaration

    Return Value

    String of error message.

    -
    @@ -278,8 +294,8 @@

    Return Value

  • diff --git a/docs/Classes/RequiredRule.html b/docs/Classes/RequiredRule.html index 810da08..102f3b8 100644 --- a/docs/Classes/RequiredRule.html +++ b/docs/Classes/RequiredRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,11 +136,11 @@

    RequiredRule

    -
    public class RequiredRule: Rule
    +
    public class RequiredRule: Rule
    -

    RequiredRule is a subclass of Rule that defines how a required text field is validated.

    +

    RequiredRule is a subclass of Rule that defines how a required field is validated.

    @@ -127,9 +149,9 @@

    RequiredRule

  • @@ -137,7 +159,7 @@

    RequiredRule

    -

    Initializes RequiredRule object with error message. Used to validate a field that requires text.

    +

    Initializes RequiredRule object with error message. Used to validate a field that requires text.

    @@ -161,7 +183,6 @@

    Parameters

    String of error message.

    -
    @@ -170,8 +191,7 @@

    Parameters

    Return Value

    -

    An initialized RequiredRule object, or nil if an object could not be created for some reason that would not result in an exception.

    - +

    An initialized RequiredRule object, or nil if an object could not be created for some reason that would not result in an exception.

    @@ -179,9 +199,9 @@

    Return Value

  • @@ -189,14 +209,14 @@

    Return Value

    -

    Validates a text field.

    +

    Validates a field.

    Declaration

    Swift

    -
    public func validate(value: String) -> Bool
    +
    public func validate(_ value: String) -> Bool
    @@ -213,7 +233,6 @@

    Parameters

    String to checked for validation.

    -
    @@ -223,7 +242,6 @@

    Parameters

    Return Value

    Boolean value. True if validation is successful; False if validation fails.

    -
    @@ -231,9 +249,9 @@

    Return Value

  • @@ -255,7 +273,6 @@

    Declaration

    Return Value

    String of error message.

    -
  • @@ -265,8 +282,8 @@

    Return Value

    diff --git a/docs/Classes/ValidationError.html b/docs/Classes/ValidationError.html index 737c859..3de740c 100644 --- a/docs/Classes/ValidationError.html +++ b/docs/Classes/ValidationError.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -118,7 +140,7 @@

    ValidationError

    -

    The ValidationError class is used for representing errors of a failed validation. It contains the text field, error label, and error message of a failed validation.

    +

    The ValidationError class is used for representing errors of a failed validation. It contains the field, error label, and error message of a failed validation.

    @@ -127,9 +149,9 @@

    ValidationError

  • - - - textField + + + field
    @@ -137,14 +159,14 @@

    ValidationError

    -

    the textField of the field

    +

    the Validatable field of the field

    Declaration

    Swift

    -
    public let textField:UITextField
    +
    public let field:ValidatableField
    @@ -208,74 +230,9 @@

    Declaration

  • -
    -
    -
    -
    -
    -

    Initializes ValidationError object with a textField and error.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(textField:UITextField, error:String)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - textField - - -
    -

    UITextField that holds textField.

    - -
    -
    - - errorMessage - - -
    -

    String that holds error message.

    - -
    -
    -
    -
    -

    Return Value

    -

    An initialized object, or nil if an object could not be created for some reason that would not result in an exception.

    - -
    -
    -
    -
  • -
  • -
    @@ -283,14 +240,14 @@

    Return Value

    -

    Initializes ValidationError object with a textField, errorLabel, and errorMessage.

    +

    Initializes ValidationError object with a field, errorLabel, and errorMessage.

    Declaration

    Swift

    -
    public init(textField:UITextField, errorLabel:UILabel?, error:String)
    +
    public init(field:ValidatableField, errorLabel:UILabel?, error:String)
    @@ -301,13 +258,12 @@

    Parameters

    - textField + field
    -

    UITextField that holds textField.

    - +

    Validatable field that holds field.

    @@ -320,7 +276,6 @@

    Parameters

    UILabel that holds error label.

    -
    @@ -333,7 +288,6 @@

    Parameters

    String that holds error message.

    -
    @@ -343,7 +297,6 @@

    Parameters

    Return Value

    An initialized object, or nil if an object could not be created for some reason that would not result in an exception.

    -
    @@ -353,8 +306,8 @@

    Return Value

  • diff --git a/docs/Classes/ValidationRule.html b/docs/Classes/ValidationRule.html index 2fc45e3..14e4a43 100644 --- a/docs/Classes/ValidationRule.html +++ b/docs/Classes/ValidationRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -118,7 +140,7 @@

    ValidationRule

    -

    ValidationRule is a class that creates an object which holds validation info of a text field.

    +

    ValidationRule is a class that creates an object which holds validation info of a field.

    @@ -127,9 +149,9 @@

    ValidationRule

  • - - - textField + + + field
    @@ -137,14 +159,14 @@

    ValidationRule

    -

    the text field of the field

    +

    the field of the field

    Declaration

    Swift

    -
    public var textField:UITextField
    +
    public var field:ValidatableField
    @@ -198,7 +220,7 @@

    Declaration

    Declaration

    Swift

    -
    public var rules:[Rule] = []
    +
    public var rules:[Rule] = []
    @@ -208,9 +230,9 @@

    Declaration

  • @@ -218,14 +240,14 @@

    Declaration

    -

    Initializes ValidationRule instance with text field, rules, and errorLabel.

    +

    Initializes ValidationRule instance with field, rules, and errorLabel.

    Declaration

    Swift

    -
    public init(textField: UITextField, rules:[Rule], errorLabel:UILabel?)
    +
    public init(field: ValidatableField, rules:[Rule], errorLabel:UILabel?)
    @@ -236,13 +258,12 @@

    Parameters

    - textField + field
    -

    text field that holds actual text in text field.

    - +

    field that holds actual text in field.

    @@ -254,8 +275,7 @@

    Parameters

    -

    label that holds error label of text field.

    - +

    label that holds error label of field.

    @@ -267,8 +287,7 @@

    Parameters

    -

    array of Rule objects, which text field will be validated against.

    - +

    array of Rule objects, which field will be validated against.

    @@ -277,8 +296,7 @@

    Parameters

    Return Value

    -

    An initialized ValidationRule object, or nil if an object could not be created for some reason that would not result in an exception.

    - +

    An initialized ValidationRule object, or nil if an object could not be created for some reason that would not result in an exception.

  • @@ -286,9 +304,9 @@

    Return Value

  • @@ -296,22 +314,20 @@

    Return Value

    -

    Used to validate text field against its validation rules. -- returns: ValidationError object if at least one error is found. Nil is returned if there are no validation errors.

    +

    Used to validate field against its validation rules.

    Declaration

    Swift

    -
    public func validateField() -> ValidationError?
    +
    public func validateField() -> ValidationError?

    Return Value

    ValidationError object if at least one error is found. Nil is returned if there are no validation errors.

    -
    @@ -321,8 +337,8 @@

    Return Value

    diff --git a/docs/Classes/Validator.html b/docs/Classes/Validator.html index cdeb6f1..8de9239 100644 --- a/docs/Classes/Validator.html +++ b/docs/Classes/Validator.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@
  • + @@ -95,17 +98,36 @@ + +
    @@ -128,9 +150,9 @@

    Validator

  • @@ -145,7 +167,7 @@

    Validator

    Declaration

    Swift

    -
    public var validations = [UITextField:ValidationRule]()
    +
    public var validations = ValidatorDictionary<ValidationRule>()
    @@ -155,9 +177,9 @@

    Declaration

  • - + - errors + errors
    @@ -172,7 +194,7 @@

    Declaration

    Declaration

    Swift

    -
    public var errors = [UITextField:ValidationError]()
    +
    public var errors = ValidatorDictionary<ValidationError>()
    @@ -182,9 +204,9 @@

    Declaration

  • - + - init() + init()
    @@ -198,14 +220,13 @@

    Declaration

    Declaration

    Swift

    -
    public init(){}
    +
    public init()

    Return Value

    An initialized object, or nil if an object could not be created for some reason that would not result in an exception.

    -
    @@ -224,9 +245,9 @@

    Public functions

  • @@ -242,7 +263,7 @@

    Public functions

    Declaration

    Swift

    -
    public func validateField(textField: UITextField, callback: (error:ValidationError?) -> Void)
    +
    public func validateField(_ field: ValidatableField, callback: (_ error:ValidationError?) -> Void)
    @@ -253,13 +274,12 @@

    Parameters

    - textField + field

    Holds validator field data.

    -
    @@ -269,7 +289,6 @@

    Parameters

    Return Value

    No return value.

    -
    @@ -288,9 +307,9 @@

    Using Keys

  • @@ -305,7 +324,7 @@

    Using Keys

    Declaration

    Swift

    -
    public func styleTransformers(success success:((validationRule:ValidationRule)->Void)?, error:((validationError:ValidationError)->Void)?)
    +
    public func styleTransformers(success:((_ validationRule:ValidationRule)->Void)?, error:((_ validationError:ValidationError)->Void)?)
    @@ -322,7 +341,6 @@

    Parameters

    A closure which is called with validationRule, an object that holds validation data

    -
    @@ -335,7 +353,6 @@

    Parameters

    A closure which is called with validationError, an object that holds validation error data

    -
    @@ -345,7 +362,6 @@

    Parameters

    Return Value

    No return value

    -
    @@ -353,74 +369,9 @@

    Return Value

  • -
    -
    -
    -
    -
    -

    This method is used to add a field to validator.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func registerField(textField:UITextField, rules:[Rule])
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - textField - - -
    -

    field that is to be validated.

    - -
    -
    - - Rule - - -
    -

    An array which holds different rules to validate against textField.

    - -
    -
    -
    -
    -

    Return Value

    -

    No return value

    - -
    -
    -
    -
  • -
  • -
    @@ -435,7 +386,7 @@

    Return Value

    Declaration

    Swift

    -
    public func registerField(textField:UITextField, errorLabel:UILabel, rules:[Rule])
    +
    public func registerField(_ field: ValidatableField, errorLabel:UILabel? = nil, rules:[Rule])
    @@ -446,13 +397,12 @@

    Parameters

    - textfield + field

    field that is to be validated.

    -
    @@ -465,7 +415,6 @@

    Parameters

    A UILabel that holds error label data

    -
    @@ -477,8 +426,7 @@

    Parameters

    -

    A Rule array that holds different rules that apply to said textField.

    - +

    A Rule array that holds different rules that apply to said field.

    @@ -488,7 +436,6 @@

    Parameters

    Return Value

    No return value

    -
    @@ -496,9 +443,9 @@

    Return Value

  • @@ -513,7 +460,7 @@

    Return Value

    Declaration

    Swift

    -
    public func unregisterField(textField:UITextField)
    +
    public func unregisterField(_ field:ValidatableField)
    @@ -524,13 +471,12 @@

    Parameters

    - textField + field
    -

    field used to locate and remove textField from validator.

    - +

    field used to locate and remove field from validator.

    @@ -540,7 +486,6 @@

    Parameters

    Return Value

    No return value

    -
    @@ -548,9 +493,9 @@

    Return Value

  • @@ -565,14 +510,13 @@

    Return Value

    Declaration

    Swift

    -
    public func validate(delegate:ValidationDelegate)
    +
    public func validate(_ delegate:ValidationDelegate)

    Return Value

    No return value.

    -
    @@ -580,9 +524,9 @@

    Return Value

  • @@ -597,7 +541,7 @@

    Return Value

    Declaration

    Swift

    -
    public func validate(callback:(errors:[UITextField:ValidationError])->Void) -> Void
    +
    public func validate(_ callback:(_ errors:[(Validatable, ValidationError)])->Void) -> Void
    @@ -613,8 +557,7 @@

    Parameters

    -

    A closure which is called with errors, a dictionary of type UITextField:ValidationError.

    - +

    A closure which is called with errors, a dictionary of type Validatable:ValidationError.

    @@ -624,7 +567,6 @@

    Parameters

    Return Value

    No return value.

    -
    @@ -634,8 +576,8 @@

    Return Value

  • diff --git a/docs/Classes/ZipCodeRule.html b/docs/Classes/ZipCodeRule.html index 7061edf..2b22067 100644 --- a/docs/Classes/ZipCodeRule.html +++ b/docs/Classes/ZipCodeRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,7 +136,7 @@

    ZipCodeRule

    -
    public class ZipCodeRule: RegexRule
    +
    public class ZipCodeRule: RegexRule
    @@ -127,9 +149,9 @@

    ZipCodeRule

  • @@ -137,7 +159,7 @@

    ZipCodeRule

    -

    Initializes a ZipCodeRule object.

    +

    Initializes a ZipCodeRule object.

    @@ -161,7 +183,6 @@

    Parameters

    String that holds error message.

    -
    @@ -171,7 +192,6 @@

    Parameters

    Return Value

    An initialized object, or nil if an object could not be created for some reason that would not result in an exception.

    -
    @@ -181,8 +201,8 @@

    Return Value

  • diff --git a/docs/Extensions.html b/docs/Extensions.html new file mode 100644 index 0000000..538b6f5 --- /dev/null +++ b/docs/Extensions.html @@ -0,0 +1,174 @@ + + + + Extensions Reference + + + + + + + + + +
    +
    +

    SwiftValidator Docs (92% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Extensions

    +

    The following extensions are available globally.

    + +
    +
    +
    + +
    +
    +
    + +
    +
    + + + diff --git a/docs/Extensions/UITextField.html b/docs/Extensions/UITextField.html new file mode 100644 index 0000000..c391b4d --- /dev/null +++ b/docs/Extensions/UITextField.html @@ -0,0 +1,174 @@ + + + + UITextField Extension Reference + + + + + + + + + + +
    +
    +

    SwiftValidator Docs (92% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    UITextField

    +

    Undocumented

    + +
    +
    +
    + +
    +
    +
    + +
    +
    + + + diff --git a/docs/Protocols.html b/docs/Protocols.html index c4e9363..689064e 100644 --- a/docs/Protocols.html +++ b/docs/Protocols.html @@ -13,7 +13,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -62,6 +62,9 @@ + @@ -94,17 +97,36 @@ + +
    @@ -147,6 +169,30 @@

    Declaration

    +
    + +
    • @@ -170,7 +216,7 @@

      Declaration

      Declaration

      Swift

      -
      @objc public protocol ValidationDelegate
      +
      public protocol ValidationDelegate
    @@ -182,8 +228,8 @@

    Declaration

    diff --git a/docs/Protocols/Rule.html b/docs/Protocols/Rule.html index 0d53231..e686ace 100644 --- a/docs/Protocols/Rule.html +++ b/docs/Protocols/Rule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -127,9 +149,9 @@

    Rule

  • @@ -137,14 +159,14 @@

    Rule

    -

    Validates text of a text field.

    +

    Validates text of a field.

    Declaration

    Swift

    -
    func validate(value: String) -> Bool
    +
    func validate(_ value: String) -> Bool
    @@ -161,7 +183,6 @@

    Parameters

    String of text to be validated.

    -
    @@ -171,7 +192,6 @@

    Parameters

    Return Value

    Boolean value. True if validation is successful; False if validation fails.

    -
    @@ -179,9 +199,9 @@

    Return Value

  • @@ -189,7 +209,7 @@

    Return Value

    -

    Displays error message of a text field that has failed validation.

    +

    Displays error message of a field that has failed validation.

    @@ -203,7 +223,6 @@

    Declaration

    Return Value

    String of error message.

    -
    @@ -213,8 +232,8 @@

    Return Value

  • diff --git a/docs/Protocols/Validatable.html b/docs/Protocols/Validatable.html new file mode 100644 index 0000000..72c243d --- /dev/null +++ b/docs/Protocols/Validatable.html @@ -0,0 +1,174 @@ + + + + Validatable Protocol Reference + + + + + + + + + + +
    +
    +

    SwiftValidator Docs (92% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Validatable

    +

    Undocumented

    + +
    +
    +
    + +
    +
    +
    + +
    +
    + + + diff --git a/docs/Protocols/ValidationDelegate.html b/docs/Protocols/ValidationDelegate.html index 1ab04ce..e0daa77 100644 --- a/docs/Protocols/ValidationDelegate.html +++ b/docs/Protocols/ValidationDelegate.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,7 +136,7 @@

    ValidationDelegate

    -
    @objc public protocol ValidationDelegate
    +
    public protocol ValidationDelegate
    @@ -127,9 +149,9 @@

    ValidationDelegate

  • @@ -151,7 +173,6 @@

    Declaration

    Return Value

    No return value.

    -
    @@ -159,9 +180,9 @@

    Return Value

  • @@ -176,14 +197,13 @@

    Return Value

    Declaration

    Swift

    -
    func validationFailed(errors: [UITextField:ValidationError])
    +
    func validationFailed(_ errors: [(Validatable, ValidationError)])

    Return Value

    No return value.

    -
  • @@ -193,8 +213,8 @@

    Return Value

    diff --git a/docs/Structs.html b/docs/Structs.html new file mode 100644 index 0000000..efe5e94 --- /dev/null +++ b/docs/Structs.html @@ -0,0 +1,174 @@ + + + + Structs Reference + + + + + + + + + +
    +
    +

    SwiftValidator Docs (92% documented)

    +
    +
    +
    + +
    +
    + + +
    + + + diff --git a/docs/Structs/ValidatorDictionary.html b/docs/Structs/ValidatorDictionary.html new file mode 100644 index 0000000..c8a346b --- /dev/null +++ b/docs/Structs/ValidatorDictionary.html @@ -0,0 +1,238 @@ + + + + ValidatorDictionary Struct Reference + + + + + + + + + + +
    +
    +

    SwiftValidator Docs (92% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    ValidatorDictionary

    +

    Undocumented

    + +
    +
    +
    +
      +
    • +
      + + + + removeAll() + +
      +
      +
      +
      +
      +
      +

      Undocumented

      + +
      +
      +
      +
    • +
    • +
      + + + + removeValueForKey(_:) + +
      +
      +
      +
      +
      +
      +

      Undocumented

      + +
      +
      +
      +
    • +
    • +
      + + + + isEmpty + +
      +
      +
      +
      +
      +
      +

      Undocumented

      + +
      +
      +
      +
    • +
    • +
      + + + + makeIterator() + +
      +
      +
      +
      +
      +
      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public func makeIterator() -> DictionaryIterator<ObjectIdentifier ,T>
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/css/jazzy.css b/docs/css/jazzy.css index 2a7da3a..d628282 100644 --- a/docs/css/jazzy.css +++ b/docs/css/jazzy.css @@ -139,7 +139,8 @@ header { .nav-group-task { font-size: 0.9em; - list-style-type: none; } + list-style-type: none; + white-space: nowrap; } .nav-group-task a { color: #888; } @@ -163,6 +164,11 @@ header { padding-top: 10px; } .main-content section .task-group-section .task-group:first-of-type .section-name { padding-top: 15px; } + .main-content section .heading:before { + content: ""; + display: block; + padding-top: 70px; + margin: -70px 0 0; } .section { padding: 0 25px; } diff --git a/docs/docsets/SwiftValidator.docset/Contents/Info.plist b/docs/docsets/SwiftValidator.docset/Contents/Info.plist index ec9b698..00d013e 100644 --- a/docs/docsets/SwiftValidator.docset/Contents/Info.plist +++ b/docs/docsets/SwiftValidator.docset/Contents/Info.plist @@ -7,7 +7,7 @@ CFBundleName SwiftValidator DocSetPlatformFamily - jazzy + swiftvalidator isDashDocset dashIndexFilePath diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes.html b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes.html index 8b7f89c..0e4a174 100644 --- a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes.html +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes.html @@ -13,7 +13,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -62,6 +62,9 @@ + @@ -94,17 +97,36 @@ + +
    @@ -138,7 +160,7 @@

    Classes

    Declaration

    Swift

    -
    public class EmailRule: RegexRule
    +
    public class EmailRule: RegexRule
    @@ -170,7 +192,7 @@

    Declaration

    Declaration

    Swift

    -
    public class FullNameRule : Rule
    +
    public class FullNameRule : Rule
    @@ -202,7 +224,7 @@

    Declaration

    Declaration

    Swift

    -
    public class ZipCodeRule: RegexRule
    +
    public class ZipCodeRule: RegexRule
    @@ -234,7 +256,7 @@

    Declaration

    Declaration

    Swift

    -
    public class PasswordRule : RegexRule
    +
    public class PasswordRule : RegexRule
    @@ -267,7 +289,7 @@

    Declaration

    Declaration

    Swift

    -
    public class AlphaNumericRule: CharacterSetRule
    +
    public class AlphaNumericRule: CharacterSetRule
    @@ -299,7 +321,7 @@

    Declaration

    Declaration

    Swift

    -
    public class CharacterSetRule: Rule
    +
    public class CharacterSetRule: Rule
    @@ -331,7 +353,7 @@

    Declaration

    Declaration

    Swift

    -
    public class PhoneNumberRule: RegexRule
    +
    public class PhoneNumberRule: RegexRule
    @@ -363,7 +385,7 @@

    Declaration

    Declaration

    Swift

    -
    public class FloatRule:Rule
    +
    public class FloatRule:Rule
    @@ -395,7 +417,7 @@

    Declaration

    Declaration

    Swift

    -
    public class HexColorRule: RegexRule
    +
    public class HexColorRule: RegexRule
    @@ -452,7 +474,7 @@

    Declaration

    -

    ValidationRule is a class that creates an object which holds validation info of a text field.

    +

    ValidationRule is a class that creates an object which holds validation info of a field.

    See more
    @@ -484,8 +506,8 @@

    Declaration

    -

    ConfirmationRule is a subclass of Rule that defines how a text field that has to be equal -to another text field is validated.

    +

    ConfirmationRule is a subclass of Rule that defines how a field that has to be equal +to another field is validated.

    See more
    @@ -493,7 +515,7 @@

    Declaration

    Declaration

    Swift

    -
    public class ConfirmationRule: Rule
    +
    public class ConfirmationRule: Rule
    @@ -525,7 +547,7 @@

    Declaration

    Declaration

    Swift

    -
    public class IPV4Rule: RegexRule
    +
    public class IPV4Rule: RegexRule
    @@ -557,7 +579,7 @@

    Declaration

    Declaration

    Swift

    -
    public class ISBNRule: Rule
    +
    public class ISBNRule: Rule
    @@ -581,7 +603,7 @@

    Declaration

    -

    The ValidationError class is used for representing errors of a failed validation. It contains the text field, error label, and error message of a failed validation.

    +

    The ValidationError class is used for representing errors of a failed validation. It contains the field, error label, and error message of a failed validation.

    See more
    @@ -613,7 +635,7 @@

    Declaration

    -

    RequiredRule is a subclass of Rule that defines how a required text field is validated.

    +

    RequiredRule is a subclass of Rule that defines how a required field is validated.

    See more
    @@ -621,7 +643,7 @@

    Declaration

    Declaration

    Swift

    -
    public class RequiredRule: Rule
    +
    public class RequiredRule: Rule
    @@ -653,7 +675,39 @@

    Declaration

    Declaration

    Swift

    -
    public class RegexRule : Rule
    +
    open class RegexRule : Rule
    + +
    + +
    + + + + +
    +
      +
    • +
      + + + + IntegerRule + +
      +
      +
      +
      +
      +
      +

      IntegerRule is a subclass of Rule that is used to make sure a the text of a field is an integer.

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public class IntegerRule : Rule
      @@ -686,7 +740,7 @@

      Declaration

      Declaration

      Swift

      -
      public class AlphaRule: CharacterSetRule
      +
      public class AlphaRule: CharacterSetRule
      @@ -718,7 +772,7 @@

      Declaration

      Declaration

      Swift

      -
      public class MinLengthRule: Rule
      +
      public class MinLengthRule: Rule
    @@ -750,7 +804,7 @@

    Declaration

    Declaration

    Swift

    -
    public class MaxLengthRule: Rule
    +
    public class MaxLengthRule: Rule
    @@ -774,7 +828,7 @@

    Declaration

    -

    ExactLengthRule is a subclass of Rule that is used to make sure a the text of a text field is an exact length.

    +

    ExactLengthRule is a subclass of Rule that is used to make sure a the text of a field is an exact length.

    See more
    @@ -782,7 +836,7 @@

    Declaration

    Declaration

    Swift

    -
    public class ExactLengthRule : Rule
    +
    public class ExactLengthRule : Rule
    @@ -794,8 +848,8 @@

    Declaration

    diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/AlphaNumericRule.html b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/AlphaNumericRule.html index 8b7d92d..51df38b 100644 --- a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/AlphaNumericRule.html +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/AlphaNumericRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,7 +136,7 @@

    AlphaNumericRule

    -
    public class AlphaNumericRule: CharacterSetRule
    +
    public class AlphaNumericRule: CharacterSetRule
    @@ -128,9 +150,9 @@

    AlphaNumericRule

  • @@ -138,7 +160,7 @@

    AlphaNumericRule

    -

    Initializes a AlphaNumericRule object to verify that field has valid set of alphanumeric characters.

    +

    Initializes a AlphaNumericRule object to verify that field has valid set of alphanumeric characters.

    @@ -162,7 +184,6 @@

    Parameters

    String of error message.

    -
    @@ -172,7 +193,6 @@

    Parameters

    Return Value

    An initialized object, or nil if an object could not be created for some reason that would not result in an exception.

    -
    @@ -182,8 +202,8 @@

    Return Value

  • diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/AlphaRule.html b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/AlphaRule.html index 71f1d81..bcc184e 100644 --- a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/AlphaRule.html +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/AlphaRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,7 +136,7 @@

    AlphaRule

    -
    public class AlphaRule: CharacterSetRule
    +
    public class AlphaRule: CharacterSetRule
    @@ -128,9 +150,9 @@

    AlphaRule

  • @@ -138,7 +160,7 @@

    AlphaRule

    -

    Initializes an AlphaRule object to verify that a field has valid set of alpha characters.

    +

    Initializes an AlphaRule object to verify that a field has valid set of alpha characters.

    @@ -162,7 +184,6 @@

    Parameters

    String of error message.

    -
    @@ -172,7 +193,6 @@

    Parameters

    Return Value

    An initialized object, or nil if an object could not be created for some reason.

    -
    @@ -182,8 +202,8 @@

    Return Value

  • diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/CharacterSetRule.html b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/CharacterSetRule.html index c472ede..1616fab 100644 --- a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/CharacterSetRule.html +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/CharacterSetRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,7 +136,7 @@

    CharacterSetRule

    -
    public class CharacterSetRule: Rule
    +
    public class CharacterSetRule: Rule
    @@ -127,9 +149,9 @@

    CharacterSetRule

  • @@ -137,14 +159,14 @@

    CharacterSetRule

    -

    Initializes a CharacterSetRule object to verify that field has valid set of characters.

    +

    Initializes a CharacterSetRule object to verify that field has valid set of characters.

    Declaration

    Swift

    -
    public init(characterSet: NSCharacterSet, message: String = "Enter valid alpha")
    +
    public init(characterSet: CharacterSet, message: String = "Enter valid alpha")
    @@ -161,7 +183,6 @@

    Parameters

    NSCharacterSet that holds group of valid characters.

    -
    @@ -174,7 +195,6 @@

    Parameters

    String of error message.

    -
    @@ -184,7 +204,6 @@

    Parameters

    Return Value

    An initialized object, or nil if an object could not be created for some reason that would not result in an exception.

    -
    @@ -192,9 +211,9 @@

    Return Value

  • @@ -209,7 +228,7 @@

    Return Value

    Declaration

    Swift

    -
    public func validate(value: String) -> Bool
    +
    public func validate(_ value: String) -> Bool
    @@ -226,7 +245,6 @@

    Parameters

    String to checked for validation.

    -
    @@ -236,7 +254,6 @@

    Parameters

    Return Value

    Boolean value. True if validation is successful; False if validation fails.

    -
  • @@ -244,9 +261,9 @@

    Return Value

  • @@ -254,7 +271,7 @@

    Return Value

    -

    Displays error message when text field fails validation.

    +

    Displays error message when field fails validation.

    @@ -268,7 +285,6 @@

    Declaration

    Return Value

    String of error message.

    -
    @@ -278,8 +294,8 @@

    Return Value

    diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/ConfirmationRule.html b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/ConfirmationRule.html index 265e6c1..2c7419a 100644 --- a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/ConfirmationRule.html +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/ConfirmationRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@
  • + @@ -95,17 +98,36 @@ + +
    @@ -114,12 +136,12 @@

    ConfirmationRule

    -
    public class ConfirmationRule: Rule
    +
    public class ConfirmationRule: Rule
    -

    ConfirmationRule is a subclass of Rule that defines how a text field that has to be equal -to another text field is validated.

    +

    ConfirmationRule is a subclass of Rule that defines how a field that has to be equal +to another field is validated.

    @@ -128,9 +150,9 @@

    ConfirmationRule

  • @@ -138,14 +160,14 @@

    ConfirmationRule

    -

    Initializes a ConfirmationRule object to validate the text of a text field that should equal the text of another text field.

    +

    Initializes a ConfirmationRule object to validate the text of a field that should equal the text of another field.

    Declaration

    Swift

    -
    public init(confirmField: UITextField, message : String = "This field does not match")
    +
    public init(confirmField: ValidatableField, message : String = "This field does not match")
    @@ -161,8 +183,7 @@

    Parameters

    -

    text field to which original text field will be compared to.

    - +

    field to which original field will be compared to.

    @@ -175,7 +196,6 @@

    Parameters

    String of error message.

    -
    @@ -185,7 +205,6 @@

    Parameters

    Return Value

    An initialized object, or nil if an object could not be created for some reason that would not result in an exception.

    -
    @@ -193,9 +212,9 @@

    Return Value

  • @@ -203,14 +222,14 @@

    Return Value

    -

    Used to validate a text field.

    +

    Used to validate a field.

    Declaration

    Swift

    -
    public func validate(value: String) -> Bool
    +
    public func validate(_ value: String) -> Bool
    @@ -227,7 +246,6 @@

    Parameters

    String to checked for validation.

    -
    @@ -237,7 +255,6 @@

    Parameters

    Return Value

    A boolean value. True if validation is successful; False if validation fails.

    -
    @@ -245,9 +262,9 @@

    Return Value

  • @@ -269,7 +286,6 @@

    Declaration

    Return Value

    String of error message.

    -
  • @@ -279,8 +295,8 @@

    Return Value

    diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/EmailRule.html b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/EmailRule.html index 7e29119..f387900 100644 --- a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/EmailRule.html +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/EmailRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,7 +136,7 @@

    EmailRule

    -
    public class EmailRule: RegexRule
    +
    public class EmailRule: RegexRule
    @@ -127,9 +149,9 @@

    EmailRule

  • @@ -137,7 +159,7 @@

    EmailRule

    -

    Initializes an EmailRule object to validate an email text field.

    +

    Initializes an EmailRule object to validate an email field.

    @@ -161,7 +183,6 @@

    Parameters

    String of error message.

    -
    @@ -171,7 +192,6 @@

    Parameters

    Return Value

    An initialized object, or nil if an object could not be created for some reason that would not result in an exception.

    -
    @@ -181,8 +201,8 @@

    Return Value

  • diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/ExactLengthRule.html b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/ExactLengthRule.html index d17e840..855723b 100644 --- a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/ExactLengthRule.html +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/ExactLengthRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,11 +136,11 @@

    ExactLengthRule

    -
    public class ExactLengthRule : Rule
    +
    public class ExactLengthRule : Rule
    -

    ExactLengthRule is a subclass of Rule that is used to make sure a the text of a text field is an exact length.

    +

    ExactLengthRule is a subclass of Rule that is used to make sure a the text of a field is an exact length.

    @@ -127,9 +149,9 @@

    ExactLengthRule

  • @@ -137,7 +159,7 @@

    ExactLengthRule

    -

    Initializes an ExactLengthRule object to validate the text of a text field against an exact length.

    +

    Initializes an ExactLengthRule object to validate the text of a field against an exact length.

    @@ -161,7 +183,6 @@

    Parameters

    Integer value of exact string length being specified.

    -
    @@ -174,7 +195,6 @@

    Parameters

    String of error message.

    -
    @@ -183,8 +203,7 @@

    Parameters

    Return Value

    -

    An initialized ExactLengthRule object, or nil if an object could not be created for some reason. that would not result in an exception.

    - +

    An initialized ExactLengthRule object, or nil if an object could not be created for some reason. that would not result in an exception.

    @@ -192,9 +211,9 @@

    Return Value

  • @@ -202,14 +221,14 @@

    Return Value

    -

    Used to validate a text field.

    +

    Used to validate a field.

    Declaration

    Swift

    -
    public func validate(value: String) -> Bool
    +
    public func validate(_ value: String) -> Bool
    @@ -226,7 +245,6 @@

    Parameters

    String to checked for validation.

    -
    @@ -236,7 +254,6 @@

    Parameters

    Return Value

    A boolean value. True if validation is successful; False if validation fails.

    -
    @@ -244,9 +261,9 @@

    Return Value

  • @@ -254,7 +271,7 @@

    Return Value

    -

    Displays error message if a text field fails validation.

    +

    Displays error message if a field fails validation.

    @@ -268,7 +285,6 @@

    Declaration

    Return Value

    String of error message.

    -
    @@ -278,8 +294,8 @@

    Return Value

  • diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/FloatRule.html b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/FloatRule.html index 98a6226..491abe0 100644 --- a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/FloatRule.html +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/FloatRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,7 +136,7 @@

    FloatRule

    -
    public class FloatRule:Rule
    +
    public class FloatRule:Rule
    @@ -127,9 +149,9 @@

    FloatRule

  • @@ -137,7 +159,7 @@

    FloatRule

    -

    Initializes a FloatRule object to validate that the text of a text field is a floating point number.

    +

    Initializes a FloatRule object to validate that the text of a field is a floating point number.

    @@ -161,7 +183,6 @@

    Parameters

    String of error message.

    -
    @@ -171,7 +192,6 @@

    Parameters

    Return Value

    An initialized object, or nil if an object could not be created for some reason that would not result in an exception.

    -
    @@ -179,9 +199,9 @@

    Return Value

  • @@ -189,14 +209,14 @@

    Return Value

    -

    Used to validate text field.

    +

    Used to validate field.

    Declaration

    Swift

    -
    public func validate(value: String) -> Bool
    +
    public func validate(_ value: String) -> Bool
    @@ -213,7 +233,6 @@

    Parameters

    String to checked for validation.

    -
    @@ -223,7 +242,6 @@

    Parameters

    Return Value

    Boolean value. True if validation is successful; False if validation fails.

    -
    @@ -231,9 +249,9 @@

    Return Value

  • @@ -241,7 +259,7 @@

    Return Value

    -

    Displays error message when text field fails validation.

    +

    Displays error message when field fails validation.

    @@ -255,7 +273,6 @@

    Declaration

    Return Value

    String of error message.

    -
    @@ -265,8 +282,8 @@

    Return Value

  • diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/FullNameRule.html b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/FullNameRule.html index 116bc21..91d3e97 100644 --- a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/FullNameRule.html +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/FullNameRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,7 +136,7 @@

    FullNameRule

    -
    public class FullNameRule : Rule
    +
    public class FullNameRule : Rule
    @@ -127,9 +149,9 @@

    FullNameRule

  • @@ -137,7 +159,7 @@

    FullNameRule

    -

    Initializes a FullNameRule object that is used to verify that text in text field is a full name.

    +

    Initializes a FullNameRule object that is used to verify that text in field is a full name.

    @@ -161,7 +183,6 @@

    Parameters

    String of error message.

    -
    @@ -170,8 +191,7 @@

    Parameters

    Return Value

    -

    An initialized FullNameRule object, or nil if an object could not be created for some reason that would not result in an exception.

    - +

    An initialized FullNameRule object, or nil if an object could not be created for some reason that would not result in an exception.

    @@ -179,9 +199,9 @@

    Return Value

  • @@ -189,14 +209,14 @@

    Return Value

    -

    Used to validate a text field.

    +

    Used to validate a field.

    Declaration

    Swift

    -
    public func validate(value: String) -> Bool
    +
    public func validate(_ value: String) -> Bool
    @@ -213,7 +233,6 @@

    Parameters

    String to checked for validation.

    -
    @@ -223,7 +242,6 @@

    Parameters

    Return Value

    A boolean value. True if validation is successful; False if validation fails.

    -
    @@ -231,9 +249,9 @@

    Return Value

  • @@ -241,7 +259,7 @@

    Return Value

    -

    Used to display error message of a text field that has failed validation.

    +

    Used to display error message of a field that has failed validation.

    @@ -255,7 +273,6 @@

    Declaration

    Return Value

    String of error message.

    -
    @@ -265,8 +282,8 @@

    Return Value

  • diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/HexColorRule.html b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/HexColorRule.html index 093b195..e294df9 100644 --- a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/HexColorRule.html +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/HexColorRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,7 +136,7 @@

    HexColorRule

    -
    public class HexColorRule: RegexRule
    +
    public class HexColorRule: RegexRule
    @@ -127,9 +149,9 @@

    HexColorRule

  • @@ -161,7 +183,6 @@

    Parameters

    String of error message.

    -
    @@ -171,7 +192,6 @@

    Parameters

    Return Value

    An initialized object, or nil if an object could not be created for some reason that would not result in an exception.

    -
    @@ -181,8 +201,8 @@

    Return Value

  • diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/IPV4Rule.html b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/IPV4Rule.html index 09db4c8..69a662d 100644 --- a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/IPV4Rule.html +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/IPV4Rule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,7 +136,7 @@

    IPV4Rule

    -
    public class IPV4Rule: RegexRule
    +
    public class IPV4Rule: RegexRule
    @@ -127,9 +149,9 @@

    IPV4Rule

  • @@ -137,7 +159,7 @@

    IPV4Rule

    -

    Initializes a IPV4Rule object to verify that field has text is an IPV4Rule address.

    +

    Initializes a IPV4Rule object to verify that field has text is an IPV4Rule address.

    @@ -161,7 +183,6 @@

    Parameters

    String of error message.

    -
    @@ -171,7 +192,6 @@

    Parameters

    Return Value

    An initialized object, or nil if an object could not be created for some reason that would not result in an exception.

    -
    @@ -181,8 +201,8 @@

    Return Value

  • diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/ISBNRule.html b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/ISBNRule.html index 8a84450..b289b4c 100644 --- a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/ISBNRule.html +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/ISBNRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,7 +136,7 @@

    ISBNRule

    -
    public class ISBNRule: Rule
    +
    public class ISBNRule: Rule
    @@ -127,9 +149,9 @@

    ISBNRule

  • @@ -137,7 +159,7 @@

    ISBNRule

    -

    Initializes a ISBNRule object to verify that field has text that is a ISBN number.

    +

    Initializes a ISBNRule object to verify that field has text that is a ISBN number.

    @@ -161,7 +183,6 @@

    Parameters

    String of error message.

    -
    @@ -171,7 +192,6 @@

    Parameters

    Return Value

    An initialized object, or nil if an object could not be created for some reason that would not result in an exception.

    -
    @@ -179,9 +199,9 @@

    Return Value

  • @@ -189,14 +209,14 @@

    Return Value

    -

    Method used to validate text field.

    +

    Method used to validate field.

    Declaration

    Swift

    -
    public func validate(value: String) -> Bool
    +
    public func validate(_ value: String) -> Bool
    @@ -213,7 +233,6 @@

    Parameters

    String to checked for validation.

    -
    @@ -223,7 +242,6 @@

    Parameters

    Return Value

    Boolean value. True if validation is successful; False if validation fails.

    -
    @@ -231,9 +249,9 @@

    Return Value

  • @@ -241,7 +259,7 @@

    Return Value

    -

    Method used to dispaly error message when text field fails validation.

    +

    Method used to dispaly error message when field fails validation.

    @@ -255,7 +273,6 @@

    Declaration

    Return Value

    String of error message.

    -
    @@ -265,8 +282,8 @@

    Return Value

  • diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/IntegerRule.html b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/IntegerRule.html new file mode 100644 index 0000000..4d95b21 --- /dev/null +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/IntegerRule.html @@ -0,0 +1,292 @@ + + + + IntegerRule Class Reference + + + + + + + + + + +
    +
    +

    SwiftValidator Docs (92% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    IntegerRule

    +
    +
    +
    public class IntegerRule : Rule
    + +
    +
    +

    IntegerRule is a subclass of Rule that is used to make sure a the text of a field is an integer.

    + +
    +
    +
    +
      +
    • +
      + + + + init(message:) + +
      +
      +
      +
      +
      +
      +

      Initializes a IntegerRule object to validate that the text of a field is only Integer.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public init(message : String = "This must be a number without a decimal")
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + message + + +
      +

      String of error message.

      +
      +
      +
      +
      +

      Return Value

      +

      An initialized object, or nil if an object could not be created for some reason that would not result in an exception.

      +
      +
      +
      +
    • +
    • +
      + + + + validate(_:) + +
      +
      +
      +
      +
      +
      +

      Used to validate field.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public func validate(_ value: String) -> Bool
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + value + + +
      +

      String to checked for validation.

      +
      +
      +
      +
      +

      Return Value

      +

      Boolean value. True if validation is successful; False if validation fails.

      +
      +
      +
      +
    • +
    • +
      + + + + errorMessage() + +
      +
      +
      +
      +
      +
      +

      Displays error message when field fails validation.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public func errorMessage() -> String
      + +
      +
      +
      +

      Return Value

      +

      String of error message.

      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/MaxLengthRule.html b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/MaxLengthRule.html index 0bf5abc..00a98dc 100644 --- a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/MaxLengthRule.html +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/MaxLengthRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,7 +136,7 @@

    MaxLengthRule

    -
    public class MaxLengthRule: Rule
    +
    public class MaxLengthRule: Rule
    @@ -127,9 +149,9 @@

    MaxLengthRule

  • - + - init() + init()
    @@ -143,14 +165,13 @@

    MaxLengthRule

    Declaration

    Swift

    -
    public init(){}
    +
    public init()

    Return Value

    -

    An initialized MaxLengthRule object, or nil if an object could not be created for some reason that would not result in an exception.

    - +

    An initialized MaxLengthRule object, or nil if an object could not be created for some reason that would not result in an exception.

  • @@ -158,9 +179,9 @@

    Return Value

  • @@ -168,7 +189,7 @@

    Return Value

    -

    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 field.

    @@ -192,7 +213,6 @@

    Parameters

    Maximum character length.

    -
    @@ -205,7 +225,6 @@

    Parameters

    String of error message.

    -
    @@ -215,7 +234,6 @@

    Parameters

    Return Value

    An initialized object, or nil if an object could not be created for some reason that would not result in an exception.

    -
    @@ -223,9 +241,9 @@

    Return Value

  • @@ -233,14 +251,14 @@

    Return Value

    -

    Used to validate a text field.

    +

    Used to validate a field.

    Declaration

    Swift

    -
    public func validate(value: String) -> Bool
    +
    public func validate(_ value: String) -> Bool
    @@ -257,7 +275,6 @@

    Parameters

    String to checked for validation.

    -
    @@ -267,7 +284,6 @@

    Parameters

    Return Value

    A boolean value. True if validation is successful; False if validation fails.

    -
    @@ -275,9 +291,9 @@

    Return Value

  • @@ -285,7 +301,7 @@

    Return Value

    -

    Displays an error message if a text field fails validation.

    +

    Displays an error message if a field fails validation.

    @@ -299,7 +315,6 @@

    Declaration

    Return Value

    String of error message.

    -
    @@ -309,8 +324,8 @@

    Return Value

    diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/MinLengthRule.html b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/MinLengthRule.html index 62139db..c9bf55f 100644 --- a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/MinLengthRule.html +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/MinLengthRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@
  • + @@ -95,17 +98,36 @@ + +
    @@ -114,7 +136,7 @@

    MinLengthRule

    -
    public class MinLengthRule: Rule
    +
    public class MinLengthRule: Rule
    @@ -127,9 +149,9 @@

    MinLengthRule

  • - + - init() + init()
    @@ -143,14 +165,13 @@

    MinLengthRule

    Declaration

    Swift

    -
    public init(){}
    +
    public init()

    Return Value

    -

    An initialized MinLengthRule object, or nil if an object could not be created for some reason that would not result in an exception.

    - +

    An initialized MinLengthRule object, or nil if an object could not be created for some reason that would not result in an exception.

    @@ -158,9 +179,9 @@

    Return Value

  • @@ -168,7 +189,7 @@

    Return Value

    -

    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 field.

    @@ -192,7 +213,6 @@

    Parameters

    Minimum character length.

    -
    @@ -205,7 +225,6 @@

    Parameters

    String of error message.

    -
    @@ -214,8 +233,7 @@

    Parameters

    Return Value

    -

    An initialized MinLengthRule object, or nil if an object could not be created for some reason that would not result in an exception.

    - +

    An initialized MinLengthRule object, or nil if an object could not be created for some reason that would not result in an exception.

    @@ -223,9 +241,9 @@

    Return Value

  • @@ -233,16 +251,14 @@

    Return Value

    -

    Validates a text field. -- parameter value: String to checked for validation. -- returns: A boolean value. True if validation is successful; False if validation fails.

    +

    Validates a field.

    Declaration

    Swift

    -
    public func validate(value: String) -> Bool
    +
    public func validate(_ value: String) -> Bool
    @@ -259,7 +275,6 @@

    Parameters

    String to checked for validation.

    -
    @@ -269,7 +284,6 @@

    Parameters

    Return Value

    A boolean value. True if validation is successful; False if validation fails.

    -
    @@ -277,9 +291,9 @@

    Return Value

  • @@ -287,7 +301,7 @@

    Return Value

    -

    Displays error message when text field has failed validation.

    +

    Displays error message when field has failed validation.

    @@ -301,7 +315,6 @@

    Declaration

    Return Value

    String of error message.

    -
    @@ -311,8 +324,8 @@

    Return Value

  • diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/PasswordRule.html b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/PasswordRule.html index d849535..35fa246 100644 --- a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/PasswordRule.html +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/PasswordRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,7 +136,7 @@

    PasswordRule

    -
    public class PasswordRule : RegexRule
    +
    public class PasswordRule : RegexRule
    @@ -127,9 +149,9 @@

    PasswordRule

  • @@ -137,7 +159,7 @@

    PasswordRule

    -

    Initializes a PasswordRule object that will validate a text field is a valid password.

    +

    Initializes a PasswordRule object that will validate a field is a valid password.

    @@ -161,7 +183,6 @@

    Parameters

    String of error message.

    -
    @@ -170,8 +191,7 @@

    Parameters

    Return Value

    -

    An initialized PasswordRule object, or nil if an object could not be created for some reason that would not result in an exception.

    - +

    An initialized PasswordRule object, or nil if an object could not be created for some reason that would not result in an exception.

    @@ -181,8 +201,8 @@

    Return Value

  • diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/PhoneNumberRule.html b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/PhoneNumberRule.html index 3b8d9b5..da40d48 100644 --- a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/PhoneNumberRule.html +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/PhoneNumberRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,7 +136,7 @@

    PhoneNumberRule

    -
    public class PhoneNumberRule: RegexRule
    +
    public class PhoneNumberRule: RegexRule
    @@ -127,9 +149,9 @@

    PhoneNumberRule

  • @@ -137,7 +159,7 @@

    PhoneNumberRule

    -

    Initializes a PhoneNumberRule object. Used to validate that a field has a valid phone number.

    +

    Initializes a PhoneNumberRule object. Used to validate that a field has a valid phone number.

    @@ -161,7 +183,6 @@

    Parameters

    Error message that is displayed if validation fails.

    -
    @@ -171,7 +192,6 @@

    Parameters

    Return Value

    An initialized PasswordRule object, or nil if an object could not be created for some reason that would not result in an exception.

    -
    @@ -181,8 +201,8 @@

    Return Value

  • diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/RegexRule.html b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/RegexRule.html index 2ec0ea8..b565c42 100644 --- a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/RegexRule.html +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/RegexRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,7 +136,7 @@

    RegexRule

    -
    public class RegexRule : Rule
    +
    open class RegexRule : Rule
    @@ -127,9 +149,9 @@

    RegexRule

  • @@ -137,7 +159,7 @@

    RegexRule

    -

    Method used to initialize RegexRule object.

    +

    Method used to initialize RegexRule object.

    @@ -161,7 +183,6 @@

    Parameters

    Regular expression string to be used in validation.

    -
    @@ -174,7 +195,6 @@

    Parameters

    String of error message.

    -
    @@ -183,8 +203,7 @@

    Parameters

    Return Value

    -

    An initialized RegexRule object, or nil if an object could not be created for some reason that would not result in an exception.

    - +

    An initialized RegexRule object, or nil if an object could not be created for some reason that would not result in an exception.

    @@ -192,9 +211,9 @@

    Return Value

  • @@ -202,14 +221,14 @@

    Return Value

    -

    Method used to validate text field.

    +

    Method used to validate field.

    Declaration

    Swift

    -
    public func validate(value: String) -> Bool
    +
    public func validate(_ value: String) -> Bool
    @@ -226,7 +245,6 @@

    Parameters

    String to checked for validation.

    -
    @@ -236,7 +254,6 @@

    Parameters

    Return Value

    Boolean value. True if validation is successful; False if validation fails.

    -
    @@ -244,9 +261,9 @@

    Return Value

  • @@ -254,7 +271,7 @@

    Return Value

    -

    Method used to dispaly error message when text field fails validation.

    +

    Method used to dispaly error message when field fails validation.

    @@ -268,7 +285,6 @@

    Declaration

    Return Value

    String of error message.

    -
    @@ -278,8 +294,8 @@

    Return Value

  • diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/RequiredRule.html b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/RequiredRule.html index 810da08..102f3b8 100644 --- a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/RequiredRule.html +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/RequiredRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,11 +136,11 @@

    RequiredRule

    -
    public class RequiredRule: Rule
    +
    public class RequiredRule: Rule
    -

    RequiredRule is a subclass of Rule that defines how a required text field is validated.

    +

    RequiredRule is a subclass of Rule that defines how a required field is validated.

    @@ -127,9 +149,9 @@

    RequiredRule

  • @@ -137,7 +159,7 @@

    RequiredRule

    -

    Initializes RequiredRule object with error message. Used to validate a field that requires text.

    +

    Initializes RequiredRule object with error message. Used to validate a field that requires text.

    @@ -161,7 +183,6 @@

    Parameters

    String of error message.

    -
    @@ -170,8 +191,7 @@

    Parameters

    Return Value

    -

    An initialized RequiredRule object, or nil if an object could not be created for some reason that would not result in an exception.

    - +

    An initialized RequiredRule object, or nil if an object could not be created for some reason that would not result in an exception.

    @@ -179,9 +199,9 @@

    Return Value

  • @@ -189,14 +209,14 @@

    Return Value

    -

    Validates a text field.

    +

    Validates a field.

    Declaration

    Swift

    -
    public func validate(value: String) -> Bool
    +
    public func validate(_ value: String) -> Bool
    @@ -213,7 +233,6 @@

    Parameters

    String to checked for validation.

    -
    @@ -223,7 +242,6 @@

    Parameters

    Return Value

    Boolean value. True if validation is successful; False if validation fails.

    -
    @@ -231,9 +249,9 @@

    Return Value

  • @@ -255,7 +273,6 @@

    Declaration

    Return Value

    String of error message.

    -
  • @@ -265,8 +282,8 @@

    Return Value

    diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/ValidationError.html b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/ValidationError.html index 737c859..3de740c 100644 --- a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/ValidationError.html +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/ValidationError.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -118,7 +140,7 @@

    ValidationError

    -

    The ValidationError class is used for representing errors of a failed validation. It contains the text field, error label, and error message of a failed validation.

    +

    The ValidationError class is used for representing errors of a failed validation. It contains the field, error label, and error message of a failed validation.

    @@ -127,9 +149,9 @@

    ValidationError

  • - - - textField + + + field
    @@ -137,14 +159,14 @@

    ValidationError

    -

    the textField of the field

    +

    the Validatable field of the field

    Declaration

    Swift

    -
    public let textField:UITextField
    +
    public let field:ValidatableField
    @@ -208,74 +230,9 @@

    Declaration

  • -
    -
    -
    -
    -
    -

    Initializes ValidationError object with a textField and error.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(textField:UITextField, error:String)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - textField - - -
    -

    UITextField that holds textField.

    - -
    -
    - - errorMessage - - -
    -

    String that holds error message.

    - -
    -
    -
    -
    -

    Return Value

    -

    An initialized object, or nil if an object could not be created for some reason that would not result in an exception.

    - -
    -
    -
    -
  • -
  • -
    @@ -283,14 +240,14 @@

    Return Value

    -

    Initializes ValidationError object with a textField, errorLabel, and errorMessage.

    +

    Initializes ValidationError object with a field, errorLabel, and errorMessage.

    Declaration

    Swift

    -
    public init(textField:UITextField, errorLabel:UILabel?, error:String)
    +
    public init(field:ValidatableField, errorLabel:UILabel?, error:String)
    @@ -301,13 +258,12 @@

    Parameters

    - textField + field
    -

    UITextField that holds textField.

    - +

    Validatable field that holds field.

    @@ -320,7 +276,6 @@

    Parameters

    UILabel that holds error label.

    -
    @@ -333,7 +288,6 @@

    Parameters

    String that holds error message.

    -
    @@ -343,7 +297,6 @@

    Parameters

    Return Value

    An initialized object, or nil if an object could not be created for some reason that would not result in an exception.

    -
    @@ -353,8 +306,8 @@

    Return Value

  • diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/ValidationRule.html b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/ValidationRule.html index 2fc45e3..14e4a43 100644 --- a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/ValidationRule.html +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/ValidationRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -118,7 +140,7 @@

    ValidationRule

    -

    ValidationRule is a class that creates an object which holds validation info of a text field.

    +

    ValidationRule is a class that creates an object which holds validation info of a field.

    @@ -127,9 +149,9 @@

    ValidationRule

  • - - - textField + + + field
    @@ -137,14 +159,14 @@

    ValidationRule

    -

    the text field of the field

    +

    the field of the field

    Declaration

    Swift

    -
    public var textField:UITextField
    +
    public var field:ValidatableField
    @@ -198,7 +220,7 @@

    Declaration

    Declaration

    Swift

    -
    public var rules:[Rule] = []
    +
    public var rules:[Rule] = []
    @@ -208,9 +230,9 @@

    Declaration

  • @@ -218,14 +240,14 @@

    Declaration

    -

    Initializes ValidationRule instance with text field, rules, and errorLabel.

    +

    Initializes ValidationRule instance with field, rules, and errorLabel.

    Declaration

    Swift

    -
    public init(textField: UITextField, rules:[Rule], errorLabel:UILabel?)
    +
    public init(field: ValidatableField, rules:[Rule], errorLabel:UILabel?)
    @@ -236,13 +258,12 @@

    Parameters

    - textField + field
    -

    text field that holds actual text in text field.

    - +

    field that holds actual text in field.

    @@ -254,8 +275,7 @@

    Parameters

    -

    label that holds error label of text field.

    - +

    label that holds error label of field.

    @@ -267,8 +287,7 @@

    Parameters

    -

    array of Rule objects, which text field will be validated against.

    - +

    array of Rule objects, which field will be validated against.

    @@ -277,8 +296,7 @@

    Parameters

    Return Value

    -

    An initialized ValidationRule object, or nil if an object could not be created for some reason that would not result in an exception.

    - +

    An initialized ValidationRule object, or nil if an object could not be created for some reason that would not result in an exception.

  • @@ -286,9 +304,9 @@

    Return Value

  • @@ -296,22 +314,20 @@

    Return Value

    -

    Used to validate text field against its validation rules. -- returns: ValidationError object if at least one error is found. Nil is returned if there are no validation errors.

    +

    Used to validate field against its validation rules.

    Declaration

    Swift

    -
    public func validateField() -> ValidationError?
    +
    public func validateField() -> ValidationError?

    Return Value

    ValidationError object if at least one error is found. Nil is returned if there are no validation errors.

    -
    @@ -321,8 +337,8 @@

    Return Value

    diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/Validator.html b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/Validator.html index cdeb6f1..8de9239 100644 --- a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/Validator.html +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/Validator.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@
  • + @@ -95,17 +98,36 @@ + +
    @@ -128,9 +150,9 @@

    Validator

  • @@ -145,7 +167,7 @@

    Validator

    Declaration

    Swift

    -
    public var validations = [UITextField:ValidationRule]()
    +
    public var validations = ValidatorDictionary<ValidationRule>()
    @@ -155,9 +177,9 @@

    Declaration

  • - + - errors + errors
    @@ -172,7 +194,7 @@

    Declaration

    Declaration

    Swift

    -
    public var errors = [UITextField:ValidationError]()
    +
    public var errors = ValidatorDictionary<ValidationError>()
    @@ -182,9 +204,9 @@

    Declaration

  • - + - init() + init()
    @@ -198,14 +220,13 @@

    Declaration

    Declaration

    Swift

    -
    public init(){}
    +
    public init()

    Return Value

    An initialized object, or nil if an object could not be created for some reason that would not result in an exception.

    -
    @@ -224,9 +245,9 @@

    Public functions

  • @@ -242,7 +263,7 @@

    Public functions

    Declaration

    Swift

    -
    public func validateField(textField: UITextField, callback: (error:ValidationError?) -> Void)
    +
    public func validateField(_ field: ValidatableField, callback: (_ error:ValidationError?) -> Void)
    @@ -253,13 +274,12 @@

    Parameters

    - textField + field

    Holds validator field data.

    -
    @@ -269,7 +289,6 @@

    Parameters

    Return Value

    No return value.

    -
    @@ -288,9 +307,9 @@

    Using Keys

  • @@ -305,7 +324,7 @@

    Using Keys

    Declaration

    Swift

    -
    public func styleTransformers(success success:((validationRule:ValidationRule)->Void)?, error:((validationError:ValidationError)->Void)?)
    +
    public func styleTransformers(success:((_ validationRule:ValidationRule)->Void)?, error:((_ validationError:ValidationError)->Void)?)
    @@ -322,7 +341,6 @@

    Parameters

    A closure which is called with validationRule, an object that holds validation data

    -
    @@ -335,7 +353,6 @@

    Parameters

    A closure which is called with validationError, an object that holds validation error data

    -
    @@ -345,7 +362,6 @@

    Parameters

    Return Value

    No return value

    -
    @@ -353,74 +369,9 @@

    Return Value

  • -
    -
    -
    -
    -
    -

    This method is used to add a field to validator.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func registerField(textField:UITextField, rules:[Rule])
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - textField - - -
    -

    field that is to be validated.

    - -
    -
    - - Rule - - -
    -

    An array which holds different rules to validate against textField.

    - -
    -
    -
    -
    -

    Return Value

    -

    No return value

    - -
    -
    -
    -
  • -
  • -
    @@ -435,7 +386,7 @@

    Return Value

    Declaration

    Swift

    -
    public func registerField(textField:UITextField, errorLabel:UILabel, rules:[Rule])
    +
    public func registerField(_ field: ValidatableField, errorLabel:UILabel? = nil, rules:[Rule])
    @@ -446,13 +397,12 @@

    Parameters

    - textfield + field

    field that is to be validated.

    -
    @@ -465,7 +415,6 @@

    Parameters

    A UILabel that holds error label data

    -
    @@ -477,8 +426,7 @@

    Parameters

    -

    A Rule array that holds different rules that apply to said textField.

    - +

    A Rule array that holds different rules that apply to said field.

    @@ -488,7 +436,6 @@

    Parameters

    Return Value

    No return value

    -
    @@ -496,9 +443,9 @@

    Return Value

  • @@ -513,7 +460,7 @@

    Return Value

    Declaration

    Swift

    -
    public func unregisterField(textField:UITextField)
    +
    public func unregisterField(_ field:ValidatableField)
    @@ -524,13 +471,12 @@

    Parameters

    - textField + field
    -

    field used to locate and remove textField from validator.

    - +

    field used to locate and remove field from validator.

    @@ -540,7 +486,6 @@

    Parameters

    Return Value

    No return value

    -
    @@ -548,9 +493,9 @@

    Return Value

  • @@ -565,14 +510,13 @@

    Return Value

    Declaration

    Swift

    -
    public func validate(delegate:ValidationDelegate)
    +
    public func validate(_ delegate:ValidationDelegate)

    Return Value

    No return value.

    -
    @@ -580,9 +524,9 @@

    Return Value

  • @@ -597,7 +541,7 @@

    Return Value

    Declaration

    Swift

    -
    public func validate(callback:(errors:[UITextField:ValidationError])->Void) -> Void
    +
    public func validate(_ callback:(_ errors:[(Validatable, ValidationError)])->Void) -> Void
    @@ -613,8 +557,7 @@

    Parameters

    -

    A closure which is called with errors, a dictionary of type UITextField:ValidationError.

    - +

    A closure which is called with errors, a dictionary of type Validatable:ValidationError.

    @@ -624,7 +567,6 @@

    Parameters

    Return Value

    No return value.

    -
    @@ -634,8 +576,8 @@

    Return Value

  • diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/ZipCodeRule.html b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/ZipCodeRule.html index 7061edf..2b22067 100644 --- a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/ZipCodeRule.html +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Classes/ZipCodeRule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,7 +136,7 @@

    ZipCodeRule

    -
    public class ZipCodeRule: RegexRule
    +
    public class ZipCodeRule: RegexRule
    @@ -127,9 +149,9 @@

    ZipCodeRule

  • @@ -137,7 +159,7 @@

    ZipCodeRule

    -

    Initializes a ZipCodeRule object.

    +

    Initializes a ZipCodeRule object.

    @@ -161,7 +183,6 @@

    Parameters

    String that holds error message.

    -
    @@ -171,7 +192,6 @@

    Parameters

    Return Value

    An initialized object, or nil if an object could not be created for some reason that would not result in an exception.

    -
    @@ -181,8 +201,8 @@

    Return Value

  • diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Extensions.html b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Extensions.html new file mode 100644 index 0000000..538b6f5 --- /dev/null +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Extensions.html @@ -0,0 +1,174 @@ + + + + Extensions Reference + + + + + + + + + +
    +
    +

    SwiftValidator Docs (92% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Extensions

    +

    The following extensions are available globally.

    + +
    +
    +
    + +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Extensions/UITextField.html b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Extensions/UITextField.html new file mode 100644 index 0000000..c391b4d --- /dev/null +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Extensions/UITextField.html @@ -0,0 +1,174 @@ + + + + UITextField Extension Reference + + + + + + + + + + +
    +
    +

    SwiftValidator Docs (92% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    UITextField

    +

    Undocumented

    + +
    +
    +
    + +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Protocols.html b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Protocols.html index c4e9363..689064e 100644 --- a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Protocols.html +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Protocols.html @@ -13,7 +13,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -62,6 +62,9 @@ + @@ -94,17 +97,36 @@ + +
    @@ -147,6 +169,30 @@

    Declaration

    +
    + +
    • @@ -170,7 +216,7 @@

      Declaration

      Declaration

      Swift

      -
      @objc public protocol ValidationDelegate
      +
      public protocol ValidationDelegate
    @@ -182,8 +228,8 @@

    Declaration

    diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Protocols/Rule.html b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Protocols/Rule.html index 0d53231..e686ace 100644 --- a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Protocols/Rule.html +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Protocols/Rule.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -127,9 +149,9 @@

    Rule

  • @@ -137,14 +159,14 @@

    Rule

    -

    Validates text of a text field.

    +

    Validates text of a field.

    Declaration

    Swift

    -
    func validate(value: String) -> Bool
    +
    func validate(_ value: String) -> Bool
    @@ -161,7 +183,6 @@

    Parameters

    String of text to be validated.

    -
    @@ -171,7 +192,6 @@

    Parameters

    Return Value

    Boolean value. True if validation is successful; False if validation fails.

    -
    @@ -179,9 +199,9 @@

    Return Value

  • @@ -189,7 +209,7 @@

    Return Value

    -

    Displays error message of a text field that has failed validation.

    +

    Displays error message of a field that has failed validation.

    @@ -203,7 +223,6 @@

    Declaration

    Return Value

    String of error message.

    -
    @@ -213,8 +232,8 @@

    Return Value

  • diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Protocols/Validatable.html b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Protocols/Validatable.html new file mode 100644 index 0000000..72c243d --- /dev/null +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Protocols/Validatable.html @@ -0,0 +1,174 @@ + + + + Validatable Protocol Reference + + + + + + + + + + +
    +
    +

    SwiftValidator Docs (92% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Validatable

    +

    Undocumented

    + +
    +
    +
    + +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Protocols/ValidationDelegate.html b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Protocols/ValidationDelegate.html index 1ab04ce..e0daa77 100644 --- a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Protocols/ValidationDelegate.html +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Protocols/ValidationDelegate.html @@ -14,7 +14,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -63,6 +63,9 @@ + @@ -95,17 +98,36 @@ + +
    @@ -114,7 +136,7 @@

    ValidationDelegate

    -
    @objc public protocol ValidationDelegate
    +
    public protocol ValidationDelegate
    @@ -127,9 +149,9 @@

    ValidationDelegate

  • @@ -151,7 +173,6 @@

    Declaration

    Return Value

    No return value.

    -
    @@ -159,9 +180,9 @@

    Return Value

  • @@ -176,14 +197,13 @@

    Return Value

    Declaration

    Swift

    -
    func validationFailed(errors: [UITextField:ValidationError])
    +
    func validationFailed(_ errors: [(Validatable, ValidationError)])

    Return Value

    No return value.

    -
  • @@ -193,8 +213,8 @@

    Return Value

    diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Structs.html b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Structs.html new file mode 100644 index 0000000..efe5e94 --- /dev/null +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Structs.html @@ -0,0 +1,174 @@ + + + + Structs Reference + + + + + + + + + +
    +
    +

    SwiftValidator Docs (92% documented)

    +
    +
    +
    + +
    +
    + + +
    + + + diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Structs/ValidatorDictionary.html b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Structs/ValidatorDictionary.html new file mode 100644 index 0000000..c8a346b --- /dev/null +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/Structs/ValidatorDictionary.html @@ -0,0 +1,238 @@ + + + + ValidatorDictionary Struct Reference + + + + + + + + + + +
    +
    +

    SwiftValidator Docs (92% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    ValidatorDictionary

    +

    Undocumented

    + +
    +
    +
    +
      +
    • +
      + + + + removeAll() + +
      +
      +
      +
      +
      +
      +

      Undocumented

      + +
      +
      +
      +
    • +
    • +
      + + + + removeValueForKey(_:) + +
      +
      +
      +
      +
      +
      +

      Undocumented

      + +
      +
      +
      +
    • +
    • +
      + + + + isEmpty + +
      +
      +
      +
      +
      +
      +

      Undocumented

      + +
      +
      +
      +
    • +
    • +
      + + + + makeIterator() + +
      +
      +
      +
      +
      +
      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public func makeIterator() -> DictionaryIterator<ObjectIdentifier ,T>
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/css/jazzy.css b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/css/jazzy.css index 2a7da3a..d628282 100644 --- a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/css/jazzy.css +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/css/jazzy.css @@ -139,7 +139,8 @@ header { .nav-group-task { font-size: 0.9em; - list-style-type: none; } + list-style-type: none; + white-space: nowrap; } .nav-group-task a { color: #888; } @@ -163,6 +164,11 @@ header { padding-top: 10px; } .main-content section .task-group-section .task-group:first-of-type .section-name { padding-top: 15px; } + .main-content section .heading:before { + content: ""; + display: block; + padding-top: 70px; + margin: -70px 0 0; } .section { padding: 0 25px; } diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/index.html b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/index.html index 6aefe33..fdd2cb6 100644 --- a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/index.html +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/index.html @@ -13,7 +13,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -62,6 +62,9 @@ + @@ -94,44 +97,69 @@ + +
    -

    SwiftValidator

    +

    SwiftValidator

    Build Status Carthage compatible codecov.io

    Swift Validator is a rule-based validation library for Swift.

    Swift Validator

    -

    Core Concepts

    +

    Core Concepts

    • UITextField + [Rule] + (and optional error UILabel) go into Validator
    • UITextField + ValidationError come out of Validator
    • Validator evaluates [Rule] sequentially and stops evaluating when a Rule fails.
    -

    Installation

    +

    Installation

    # Podfile
     source 'https://github.com/CocoaPods/Specs.git'
     platform :ios, "8.1"
     
     use_frameworks!
    -pod 'SwiftValidator', '3.0.3' 
    +
    +# As of 4.0.0, SwiftValidator has been extended beyond UITextField
    +# Note: Installing 4.x.x will break code from 3.x.x
    +pod 'SwiftValidator', :git => 'https://github.com/jpotts18/SwiftValidator.git', :tag => '4.0.0'
    +
    +# For older versions
    +pod 'SwiftValidator', :git => 'https://github.com/jpotts18/SwiftValidator.git', :tag => '3.0.5'
     

    Install into your project:

    @@ -145,7 +173,7 @@

    If you are using Carthage you will need to add this to your Cartfile

    github "jpotts18/SwiftValidator"
     
    -

    Usage

    +

    Usage

    You can now import SwiftValidator framework into your files.

    @@ -179,7 +207,7 @@

    Validate Fields on button tap or however you would like to trigger it.

    @IBAction func signupTapped(sender: AnyObject) {
    -    validator.validate(delegate:self)
    +    validator.validate(self)
     }
     
    @@ -190,18 +218,20 @@ // submit the form } -func validationFailed(errors:[UITextField:ValidationError]) { +func validationFailed(errors:[(Validatable ,ValidationError)]) { // turn the fields to red - for (field, error) in validator.errors { - field.layer.borderColor = UIColor.redColor().CGColor - field.layer.borderWidth = 1.0 + for (field, error) in errors { + if let field = field as? UITextField { + field.layer.borderColor = UIColor.redColor().CGColor + field.layer.borderWidth = 1.0 + } error.errorLabel?.text = error.errorMessage // works if you added labels error.errorLabel?.hidden = false } } -

    Single Field Validation

    +

    Single Field Validation

    You may use single field validation in some cases. This could be useful in situations such as controlling responders:

    // Don't forget to use UITextFieldDelegate
    @@ -217,7 +247,7 @@
         return true
     }
     
    -

    Custom Validation

    +

    Custom Validation

    We will create a SSNRule class to show how to create your own Validation. A United States Social Security Number (or SSN) is a field that consists of XXX-XX-XXXX.

    @@ -232,13 +262,14 @@ } } -

    Documentation

    +

    Documentation

    Checkout the docs here via @jazzydocs.

    -

    Credits

    +

    Credits

    -

    Swift Validator is written and maintained by Jeff Potter @jpotts18.

    -

    Contributing

    +

    Swift Validator is written and maintained by Jeff Potter @jpotts18. David Patterson @dave_tw12 actively works as a collaborator. Special thanks to Deniz Adalar for +adding validation beyond UITextField.

    +

    Contributing

    1. Fork it
    2. @@ -246,13 +277,14 @@
    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. +
    7. Make sure code coverage is at least 70%
    diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/js/jazzy.js b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/js/jazzy.js index 4ff9455..3965b5f 100755 --- a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/js/jazzy.js +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/js/jazzy.js @@ -38,3 +38,9 @@ $(".token").click(function(event) { } event.preventDefault(); }); + +// Dumb down quotes within code blocks that delimit strings instead of quotations +// https://github.com/realm/jazzy/issues/714 +$("code q").replaceWith(function () { + return ["\"", $(this).contents(), "\""]; +}); diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/search.json b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/search.json new file mode 100644 index 0000000..7e4b5cf --- /dev/null +++ b/docs/docsets/SwiftValidator.docset/Contents/Resources/Documents/search.json @@ -0,0 +1 @@ +{"Structs/ValidatorDictionary.html#/s:FV14SwiftValidator19ValidatorDictionary9removeAllFT_T_":{"name":"removeAll()","abstract":"

    Undocumented

    ","parent_name":"ValidatorDictionary"},"Structs/ValidatorDictionary.html#/s:FV14SwiftValidator19ValidatorDictionary17removeValueForKeyFPs9AnyObjectS_11Validatable_T_":{"name":"removeValueForKey(_:)","abstract":"

    Undocumented

    ","parent_name":"ValidatorDictionary"},"Structs/ValidatorDictionary.html#/s:vV14SwiftValidator19ValidatorDictionary7isEmptySb":{"name":"isEmpty","abstract":"

    Undocumented

    ","parent_name":"ValidatorDictionary"},"Structs/ValidatorDictionary.html#/s:FPs8Sequence12makeIteratorFT_wx8Iterator":{"name":"makeIterator()","parent_name":"ValidatorDictionary"},"Structs/ValidatorDictionary.html":{"name":"ValidatorDictionary","abstract":"

    Undocumented

    "},"Protocols/ValidationDelegate.html#/s:FP14SwiftValidator18ValidationDelegate20validationSuccessfulFT_T_":{"name":"validationSuccessful()","abstract":"

    This method will be called on delegate object when validation is successful.

    ","parent_name":"ValidationDelegate"},"Protocols/ValidationDelegate.html#/s:FP14SwiftValidator18ValidationDelegate16validationFailedFGSaTPS_11Validatable_CS_15ValidationError__T_":{"name":"validationFailed(_:)","abstract":"

    This method will be called on delegate object when validation fails.

    ","parent_name":"ValidationDelegate"},"Protocols/Validatable.html#/s:vP14SwiftValidator11Validatable14validationTextSS":{"name":"validationText","abstract":"

    Undocumented

    ","parent_name":"Validatable"},"Protocols/Rule.html#/s:FP14SwiftValidator4Rule8validateFSSSb":{"name":"validate(_:)","abstract":"

    Validates text of a field.

    ","parent_name":"Rule"},"Protocols/Rule.html#/s:FP14SwiftValidator4Rule12errorMessageFT_SS":{"name":"errorMessage()","abstract":"

    Displays error message of a field that has failed validation.

    ","parent_name":"Rule"},"Protocols/Rule.html":{"name":"Rule","abstract":"

    The Rule protocol declares the required methods for all objects that subscribe to it.

    "},"Protocols/Validatable.html":{"name":"Validatable","abstract":"

    Undocumented

    "},"Protocols/ValidationDelegate.html":{"name":"ValidationDelegate","abstract":"

    Protocol for ValidationDelegate adherents, which comes with two required methods that are called depending on whether validation succeeded or failed.

    "},"Extensions/UITextField.html#/s:vE14SwiftValidatorCSo11UITextField14validationTextSS":{"name":"validationText","abstract":"

    Undocumented

    ","parent_name":"UITextField"},"Extensions/UITextField.html":{"name":"UITextField","abstract":"

    Undocumented

    "},"Classes/ExactLengthRule.html#/s:FC14SwiftValidator15ExactLengthRulecFT6lengthSi7messageSS_S0_":{"name":"init(length:message:)","abstract":"

    Initializes an ExactLengthRule object to validate the text of a field against an exact length.

    ","parent_name":"ExactLengthRule"},"Classes/ExactLengthRule.html#/s:FC14SwiftValidator15ExactLengthRule8validateFSSSb":{"name":"validate(_:)","abstract":"

    Used to validate a field.

    ","parent_name":"ExactLengthRule"},"Classes/ExactLengthRule.html#/s:FC14SwiftValidator15ExactLengthRule12errorMessageFT_SS":{"name":"errorMessage()","abstract":"

    Displays error message if a field fails validation.

    ","parent_name":"ExactLengthRule"},"Classes/MaxLengthRule.html#/s:FC14SwiftValidator13MaxLengthRulecFT_S0_":{"name":"init()","parent_name":"MaxLengthRule"},"Classes/MaxLengthRule.html#/s:FC14SwiftValidator13MaxLengthRulecFT6lengthSi7messageSS_S0_":{"name":"init(length:message:)","abstract":"

    Initializes a MaxLengthRule object that is to validate the length of the text of a field.

    ","parent_name":"MaxLengthRule"},"Classes/MaxLengthRule.html#/s:FC14SwiftValidator13MaxLengthRule8validateFSSSb":{"name":"validate(_:)","abstract":"

    Used to validate a field.

    ","parent_name":"MaxLengthRule"},"Classes/MaxLengthRule.html#/s:FC14SwiftValidator13MaxLengthRule12errorMessageFT_SS":{"name":"errorMessage()","abstract":"

    Displays an error message if a field fails validation.

    ","parent_name":"MaxLengthRule"},"Classes/MinLengthRule.html#/s:FC14SwiftValidator13MinLengthRulecFT_S0_":{"name":"init()","parent_name":"MinLengthRule"},"Classes/MinLengthRule.html#/s:FC14SwiftValidator13MinLengthRulecFT6lengthSi7messageSS_S0_":{"name":"init(length:message:)","abstract":"

    Initializes a MaxLengthRule object that is to validate the length of the text of a field.

    ","parent_name":"MinLengthRule"},"Classes/MinLengthRule.html#/s:FC14SwiftValidator13MinLengthRule8validateFSSSb":{"name":"validate(_:)","abstract":"

    Validates a field.

    ","parent_name":"MinLengthRule"},"Classes/MinLengthRule.html#/s:FC14SwiftValidator13MinLengthRule12errorMessageFT_SS":{"name":"errorMessage()","abstract":"

    Displays error message when field has failed validation.

    ","parent_name":"MinLengthRule"},"Classes/AlphaRule.html#/s:FC14SwiftValidator9AlphaRulecFT7messageSS_S0_":{"name":"init(message:)","abstract":"

    Initializes an AlphaRule object to verify that a field has valid set of alpha characters.

    ","parent_name":"AlphaRule"},"Classes/IntegerRule.html#/s:FC14SwiftValidator11IntegerRulecFT7messageSS_S0_":{"name":"init(message:)","abstract":"

    Initializes a IntegerRule object to validate that the text of a field is only Integer.

    ","parent_name":"IntegerRule"},"Classes/IntegerRule.html#/s:FC14SwiftValidator11IntegerRule8validateFSSSb":{"name":"validate(_:)","abstract":"

    Used to validate field.

    ","parent_name":"IntegerRule"},"Classes/IntegerRule.html#/s:FC14SwiftValidator11IntegerRule12errorMessageFT_SS":{"name":"errorMessage()","abstract":"

    Displays error message when field fails validation.

    ","parent_name":"IntegerRule"},"Classes/RegexRule.html#/s:FC14SwiftValidator9RegexRulecFT5regexSS7messageSS_S0_":{"name":"init(regex:message:)","abstract":"

    Method used to initialize RegexRule object.

    ","parent_name":"RegexRule"},"Classes/RegexRule.html#/s:FC14SwiftValidator9RegexRule8validateFSSSb":{"name":"validate(_:)","abstract":"

    Method used to validate field.

    ","parent_name":"RegexRule"},"Classes/RegexRule.html#/s:FC14SwiftValidator9RegexRule12errorMessageFT_SS":{"name":"errorMessage()","abstract":"

    Method used to dispaly error message when field fails validation.

    ","parent_name":"RegexRule"},"Classes/RequiredRule.html#/s:FC14SwiftValidator12RequiredRulecFT7messageSS_S0_":{"name":"init(message:)","abstract":"

    Initializes RequiredRule object with error message. Used to validate a field that requires text.

    ","parent_name":"RequiredRule"},"Classes/RequiredRule.html#/s:FC14SwiftValidator12RequiredRule8validateFSSSb":{"name":"validate(_:)","abstract":"

    Validates a field.

    ","parent_name":"RequiredRule"},"Classes/RequiredRule.html#/s:FC14SwiftValidator12RequiredRule12errorMessageFT_SS":{"name":"errorMessage()","abstract":"

    Used to display error message when validation fails.

    ","parent_name":"RequiredRule"},"Classes/ValidationError.html#/s:vC14SwiftValidator15ValidationError5fieldPs9AnyObjectS_11Validatable_":{"name":"field","abstract":"

    the Validatable field of the field

    ","parent_name":"ValidationError"},"Classes/ValidationError.html#/s:vC14SwiftValidator15ValidationError10errorLabelGSqCSo7UILabel_":{"name":"errorLabel","abstract":"

    the error label of the field

    ","parent_name":"ValidationError"},"Classes/ValidationError.html#/s:vC14SwiftValidator15ValidationError12errorMessageSS":{"name":"errorMessage","abstract":"

    the error message of the field

    ","parent_name":"ValidationError"},"Classes/ValidationError.html#/s:FC14SwiftValidator15ValidationErrorcFT5fieldPs9AnyObjectS_11Validatable_10errorLabelGSqCSo7UILabel_5errorSS_S0_":{"name":"init(field:errorLabel:error:)","abstract":"

    Initializes ValidationError object with a field, errorLabel, and errorMessage.

    ","parent_name":"ValidationError"},"Classes/ISBNRule.html#/s:FC14SwiftValidator8ISBNRulecFT7messageSS_S0_":{"name":"init(message:)","abstract":"

    Initializes a ISBNRule object to verify that field has text that is a ISBN number.

    ","parent_name":"ISBNRule"},"Classes/ISBNRule.html#/s:FC14SwiftValidator8ISBNRule8validateFSSSb":{"name":"validate(_:)","abstract":"

    Method used to validate field.

    ","parent_name":"ISBNRule"},"Classes/ISBNRule.html#/s:FC14SwiftValidator8ISBNRule12errorMessageFT_SS":{"name":"errorMessage()","abstract":"

    Method used to dispaly error message when field fails validation.

    ","parent_name":"ISBNRule"},"Classes/IPV4Rule.html#/s:FC14SwiftValidator8IPV4RulecFT7messageSS_S0_":{"name":"init(message:)","abstract":"

    Initializes a IPV4Rule object to verify that field has text is an IPV4Rule address.

    ","parent_name":"IPV4Rule"},"Classes/ConfirmationRule.html#/s:FC14SwiftValidator16ConfirmationRulecFT12confirmFieldPs9AnyObjectS_11Validatable_7messageSS_S0_":{"name":"init(confirmField:message:)","abstract":"

    Initializes a ConfirmationRule object to validate the text of a field that should equal the text of another field.

    ","parent_name":"ConfirmationRule"},"Classes/ConfirmationRule.html#/s:FC14SwiftValidator16ConfirmationRule8validateFSSSb":{"name":"validate(_:)","abstract":"

    Used to validate a field.

    ","parent_name":"ConfirmationRule"},"Classes/ConfirmationRule.html#/s:FC14SwiftValidator16ConfirmationRule12errorMessageFT_SS":{"name":"errorMessage()","abstract":"

    Displays an error message when text field fails validation.

    ","parent_name":"ConfirmationRule"},"Classes/ValidationRule.html#/s:vC14SwiftValidator14ValidationRule5fieldPs9AnyObjectS_11Validatable_":{"name":"field","abstract":"

    the field of the field

    ","parent_name":"ValidationRule"},"Classes/ValidationRule.html#/s:vC14SwiftValidator14ValidationRule10errorLabelGSqCSo7UILabel_":{"name":"errorLabel","abstract":"

    the errorLabel of the field

    ","parent_name":"ValidationRule"},"Classes/ValidationRule.html#/s:vC14SwiftValidator14ValidationRule5rulesGSaPS_4Rule__":{"name":"rules","abstract":"

    the rules of the field

    ","parent_name":"ValidationRule"},"Classes/ValidationRule.html#/s:FC14SwiftValidator14ValidationRulecFT5fieldPs9AnyObjectS_11Validatable_5rulesGSaPS_4Rule__10errorLabelGSqCSo7UILabel__S0_":{"name":"init(field:rules:errorLabel:)","abstract":"

    Initializes ValidationRule instance with field, rules, and errorLabel.

    ","parent_name":"ValidationRule"},"Classes/ValidationRule.html#/s:FC14SwiftValidator14ValidationRule13validateFieldFT_GSqCS_15ValidationError_":{"name":"validateField()","abstract":"

    Used to validate field against its validation rules.

    ","parent_name":"ValidationRule"},"Classes/Validator.html#/s:vC14SwiftValidator9Validator11validationsGVS_19ValidatorDictionaryCS_14ValidationRule_":{"name":"validations","abstract":"

    Dictionary to hold all fields (and accompanying rules) that will undergo validation.

    ","parent_name":"Validator"},"Classes/Validator.html#/s:vC14SwiftValidator9Validator6errorsGVS_19ValidatorDictionaryCS_15ValidationError_":{"name":"errors","abstract":"

    Dictionary to hold fields (and accompanying errors) that were unsuccessfully validated.

    ","parent_name":"Validator"},"Classes/Validator.html#/s:FC14SwiftValidator9ValidatorcFT_S0_":{"name":"init()","parent_name":"Validator"},"Classes/Validator.html#/s:FC14SwiftValidator9Validator13validateFieldFTPs9AnyObjectS_11Validatable_8callbackFGSqCS_15ValidationError_T__T_":{"name":"validateField(_:callback:)","abstract":"

    This method is used to validate a single field registered to Validator. If validation is unsuccessful,","parent_name":"Validator"},"Classes/Validator.html#/s:FC14SwiftValidator9Validator17styleTransformersFT7successGSqFCS_14ValidationRuleT__5errorGSqFCS_15ValidationErrorT___T_":{"name":"styleTransformers(success:error:)","abstract":"

    This method is used to style fields that have undergone validation checks. Success callback should be used to show common success styling and error callback should be used to show common error styling.

    ","parent_name":"Validator"},"Classes/Validator.html#/s:FC14SwiftValidator9Validator13registerFieldFTPs9AnyObjectS_11Validatable_10errorLabelGSqCSo7UILabel_5rulesGSaPS_4Rule___T_":{"name":"registerField(_:errorLabel:rules:)","abstract":"

    This method is used to add a field to validator.

    ","parent_name":"Validator"},"Classes/Validator.html#/s:FC14SwiftValidator9Validator15unregisterFieldFPs9AnyObjectS_11Validatable_T_":{"name":"unregisterField(_:)","abstract":"

    This method is for removing a field validator.

    ","parent_name":"Validator"},"Classes/Validator.html#/s:FC14SwiftValidator9Validator8validateFPS_18ValidationDelegate_T_":{"name":"validate(_:)","abstract":"

    This method checks to see if all fields in validator are valid.

    ","parent_name":"Validator"},"Classes/Validator.html#/s:FC14SwiftValidator9Validator8validateFFGSaTPS_11Validatable_CS_15ValidationError__T_T_":{"name":"validate(_:)","abstract":"

    This method validates all fields in validator and sets any errors to errors parameter of callback.

    ","parent_name":"Validator"},"Classes/HexColorRule.html#/s:FC14SwiftValidator12HexColorRulecFT7messageSS_S0_":{"name":"init(message:)","abstract":"

    Initializes a HexaColorRule object to verify that field has text in hexadecimal color format.

    ","parent_name":"HexColorRule"},"Classes/FloatRule.html#/s:FC14SwiftValidator9FloatRulecFT7messageSS_S0_":{"name":"init(message:)","abstract":"

    Initializes a FloatRule object to validate that the text of a field is a floating point number.

    ","parent_name":"FloatRule"},"Classes/FloatRule.html#/s:FC14SwiftValidator9FloatRule8validateFSSSb":{"name":"validate(_:)","abstract":"

    Used to validate field.

    ","parent_name":"FloatRule"},"Classes/FloatRule.html#/s:FC14SwiftValidator9FloatRule12errorMessageFT_SS":{"name":"errorMessage()","abstract":"

    Displays error message when field fails validation.

    ","parent_name":"FloatRule"},"Classes/PhoneNumberRule.html#/s:FC14SwiftValidator15PhoneNumberRulecFT7messageSS_S0_":{"name":"init(message:)","abstract":"

    Initializes a PhoneNumberRule object. Used to validate that a field has a valid phone number.

    ","parent_name":"PhoneNumberRule"},"Classes/CharacterSetRule.html#/s:FC14SwiftValidator16CharacterSetRulecFT12characterSetV10Foundation12CharacterSet7messageSS_S0_":{"name":"init(characterSet:message:)","abstract":"

    Initializes a CharacterSetRule object to verify that field has valid set of characters.

    ","parent_name":"CharacterSetRule"},"Classes/CharacterSetRule.html#/s:FC14SwiftValidator16CharacterSetRule8validateFSSSb":{"name":"validate(_:)","abstract":"

    Used to validate field.

    ","parent_name":"CharacterSetRule"},"Classes/CharacterSetRule.html#/s:FC14SwiftValidator16CharacterSetRule12errorMessageFT_SS":{"name":"errorMessage()","abstract":"

    Displays error message when field fails validation.

    ","parent_name":"CharacterSetRule"},"Classes/AlphaNumericRule.html#/s:FC14SwiftValidator16AlphaNumericRulecFT7messageSS_S0_":{"name":"init(message:)","abstract":"

    Initializes a AlphaNumericRule object to verify that field has valid set of alphanumeric characters.

    ","parent_name":"AlphaNumericRule"},"Classes/PasswordRule.html#/s:FC14SwiftValidator12PasswordRulecFT7messageSS_S0_":{"name":"init(message:)","abstract":"

    Initializes a PasswordRule object that will validate a field is a valid password.

    ","parent_name":"PasswordRule"},"Classes/ZipCodeRule.html#/s:FC14SwiftValidator11ZipCodeRulecFT7messageSS_S0_":{"name":"init(message:)","abstract":"

    Initializes a ZipCodeRule object.

    ","parent_name":"ZipCodeRule"},"Classes/FullNameRule.html#/s:FC14SwiftValidator12FullNameRulecFT7messageSS_S0_":{"name":"init(message:)","abstract":"

    Initializes a FullNameRule object that is used to verify that text in field is a full name.

    ","parent_name":"FullNameRule"},"Classes/FullNameRule.html#/s:FC14SwiftValidator12FullNameRule8validateFSSSb":{"name":"validate(_:)","abstract":"

    Used to validate a field.

    ","parent_name":"FullNameRule"},"Classes/FullNameRule.html#/s:FC14SwiftValidator12FullNameRule12errorMessageFT_SS":{"name":"errorMessage()","abstract":"

    Used to display error message of a field that has failed validation.

    ","parent_name":"FullNameRule"},"Classes/EmailRule.html#/s:FC14SwiftValidator9EmailRulecFT7messageSS_S0_":{"name":"init(message:)","abstract":"

    Initializes an EmailRule object to validate an email field.

    ","parent_name":"EmailRule"},"Classes/EmailRule.html":{"name":"EmailRule","abstract":"

    EmailRule is a subclass of RegexRule that defines how a email is validated.

    "},"Classes/FullNameRule.html":{"name":"FullNameRule","abstract":"

    FullNameRule is a subclass of Rule that defines how a full name is validated.

    "},"Classes/ZipCodeRule.html":{"name":"ZipCodeRule","abstract":"

    ZipCodeRule is a subclass of RegexRule that represents how zip codes are to be validated.

    "},"Classes/PasswordRule.html":{"name":"PasswordRule","abstract":"

    PasswordRule is a subclass of RegexRule that defines how a password is validated.

    "},"Classes/AlphaNumericRule.html":{"name":"AlphaNumericRule","abstract":"

    AlphaNumericRule is a subclass of CharacterSetRule. It is used to verify that a field has a"},"Classes/CharacterSetRule.html":{"name":"CharacterSetRule","abstract":"

    CharacterSetRule is a subclass of Rule. It is used to validate IPV4 address fields.

    "},"Classes/PhoneNumberRule.html":{"name":"PhoneNumberRule","abstract":"

    PhoneNumberRule is a subclass of Rule that defines how a phone number is validated.

    "},"Classes/FloatRule.html":{"name":"FloatRule","abstract":"

    FloatRule is a subclass of Rule that defines how check if a value is a floating point value.

    "},"Classes/HexColorRule.html":{"name":"HexColorRule","abstract":"

    HexColorRule is a subclass of RegexRule. It is used to verify whether a field is a hexadecimal color.

    "},"Classes/Validator.html":{"name":"Validator","abstract":"

    Class that makes Validator objects. Should be added as a parameter to ViewController that will display"},"Classes/ValidationRule.html":{"name":"ValidationRule","abstract":"

    ValidationRule is a class that creates an object which holds validation info of a field.

    "},"Classes/ConfirmationRule.html":{"name":"ConfirmationRule","abstract":"

    ConfirmationRule is a subclass of Rule that defines how a field that has to be equal"},"Classes/IPV4Rule.html":{"name":"IPV4Rule","abstract":"

    IPV4Rule is a subclass of RegexRule that defines how a IPV4 address validated.

    "},"Classes/ISBNRule.html":{"name":"ISBNRule","abstract":"

    ISBNRule is a subclass of Rule. It is used to verify whether a field is a valid ISBN number.

    "},"Classes/ValidationError.html":{"name":"ValidationError","abstract":"

    The ValidationError class is used for representing errors of a failed validation. It contains the field, error label, and error message of a failed validation.

    "},"Classes/RequiredRule.html":{"name":"RequiredRule","abstract":"

    RequiredRule is a subclass of Rule that defines how a required field is validated.

    "},"Classes/RegexRule.html":{"name":"RegexRule","abstract":"

    RegexRule is a subclass of Rule that defines how a regular expression is validated.

    "},"Classes/IntegerRule.html":{"name":"IntegerRule","abstract":"

    IntegerRule is a subclass of Rule that is used to make sure a the text of a field is an integer.

    "},"Classes/AlphaRule.html":{"name":"AlphaRule","abstract":"

    AlphaRule is a subclass of CharacterSetRule. It is used to verify that a field has a"},"Classes/MinLengthRule.html":{"name":"MinLengthRule","abstract":"

    MinLengthRule is a subclass of Rule that defines how minimum character length is validated.

    "},"Classes/MaxLengthRule.html":{"name":"MaxLengthRule","abstract":"

    MaxLengthRule is a subclass of Rule that defines how maximum character length is validated.

    "},"Classes/ExactLengthRule.html":{"name":"ExactLengthRule","abstract":"

    ExactLengthRule is a subclass of Rule that is used to make sure a the text of a field is an exact length.

    "},"Classes.html":{"name":"Classes","abstract":"

    The following classes are available globally.

    "},"Extensions.html":{"name":"Extensions","abstract":"

    The following extensions are available globally.

    "},"Protocols.html":{"name":"Protocols","abstract":"

    The following protocols are available globally.

    "},"Structs.html":{"name":"Structs","abstract":"

    The following structs are available globally.

    "}} \ No newline at end of file diff --git a/docs/docsets/SwiftValidator.docset/Contents/Resources/docSet.dsidx b/docs/docsets/SwiftValidator.docset/Contents/Resources/docSet.dsidx index 3d57724..033d92d 100644 Binary files a/docs/docsets/SwiftValidator.docset/Contents/Resources/docSet.dsidx and b/docs/docsets/SwiftValidator.docset/Contents/Resources/docSet.dsidx differ diff --git a/docs/docsets/SwiftValidator.tgz b/docs/docsets/SwiftValidator.tgz index 49a6d41..1916660 100644 Binary files a/docs/docsets/SwiftValidator.tgz and b/docs/docsets/SwiftValidator.tgz differ diff --git a/docs/index.html b/docs/index.html index 6aefe33..fdd2cb6 100644 --- a/docs/index.html +++ b/docs/index.html @@ -13,7 +13,7 @@
    -

    SwiftValidator Docs (100% documented)

    +

    SwiftValidator Docs (92% documented)

    @@ -62,6 +62,9 @@ + @@ -94,44 +97,69 @@ + +
    -

    SwiftValidator

    +

    SwiftValidator

    Build Status Carthage compatible codecov.io

    Swift Validator is a rule-based validation library for Swift.

    Swift Validator

    -

    Core Concepts

    +

    Core Concepts

    • UITextField + [Rule] + (and optional error UILabel) go into Validator
    • UITextField + ValidationError come out of Validator
    • Validator evaluates [Rule] sequentially and stops evaluating when a Rule fails.
    -

    Installation

    +

    Installation

    # Podfile
     source 'https://github.com/CocoaPods/Specs.git'
     platform :ios, "8.1"
     
     use_frameworks!
    -pod 'SwiftValidator', '3.0.3' 
    +
    +# As of 4.0.0, SwiftValidator has been extended beyond UITextField
    +# Note: Installing 4.x.x will break code from 3.x.x
    +pod 'SwiftValidator', :git => 'https://github.com/jpotts18/SwiftValidator.git', :tag => '4.0.0'
    +
    +# For older versions
    +pod 'SwiftValidator', :git => 'https://github.com/jpotts18/SwiftValidator.git', :tag => '3.0.5'
     

    Install into your project:

    @@ -145,7 +173,7 @@

    If you are using Carthage you will need to add this to your Cartfile

    github "jpotts18/SwiftValidator"
     
    -

    Usage

    +

    Usage

    You can now import SwiftValidator framework into your files.

    @@ -179,7 +207,7 @@

    Validate Fields on button tap or however you would like to trigger it.

    @IBAction func signupTapped(sender: AnyObject) {
    -    validator.validate(delegate:self)
    +    validator.validate(self)
     }
     
    @@ -190,18 +218,20 @@ // submit the form } -func validationFailed(errors:[UITextField:ValidationError]) { +func validationFailed(errors:[(Validatable ,ValidationError)]) { // turn the fields to red - for (field, error) in validator.errors { - field.layer.borderColor = UIColor.redColor().CGColor - field.layer.borderWidth = 1.0 + for (field, error) in errors { + if let field = field as? UITextField { + field.layer.borderColor = UIColor.redColor().CGColor + field.layer.borderWidth = 1.0 + } error.errorLabel?.text = error.errorMessage // works if you added labels error.errorLabel?.hidden = false } } -

    Single Field Validation

    +

    Single Field Validation

    You may use single field validation in some cases. This could be useful in situations such as controlling responders:

    // Don't forget to use UITextFieldDelegate
    @@ -217,7 +247,7 @@
         return true
     }
     
    -

    Custom Validation

    +

    Custom Validation

    We will create a SSNRule class to show how to create your own Validation. A United States Social Security Number (or SSN) is a field that consists of XXX-XX-XXXX.

    @@ -232,13 +262,14 @@ } } -

    Documentation

    +

    Documentation

    Checkout the docs here via @jazzydocs.

    -

    Credits

    +

    Credits

    -

    Swift Validator is written and maintained by Jeff Potter @jpotts18.

    -

    Contributing

    +

    Swift Validator is written and maintained by Jeff Potter @jpotts18. David Patterson @dave_tw12 actively works as a collaborator. Special thanks to Deniz Adalar for +adding validation beyond UITextField.

    +

    Contributing

    1. Fork it
    2. @@ -246,13 +277,14 @@
    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. +
    7. Make sure code coverage is at least 70%
    diff --git a/docs/js/jazzy.js b/docs/js/jazzy.js index 4ff9455..3965b5f 100755 --- a/docs/js/jazzy.js +++ b/docs/js/jazzy.js @@ -38,3 +38,9 @@ $(".token").click(function(event) { } event.preventDefault(); }); + +// Dumb down quotes within code blocks that delimit strings instead of quotations +// https://github.com/realm/jazzy/issues/714 +$("code q").replaceWith(function () { + return ["\"", $(this).contents(), "\""]; +}); diff --git a/docs/search.json b/docs/search.json new file mode 100644 index 0000000..7e4b5cf --- /dev/null +++ b/docs/search.json @@ -0,0 +1 @@ +{"Structs/ValidatorDictionary.html#/s:FV14SwiftValidator19ValidatorDictionary9removeAllFT_T_":{"name":"removeAll()","abstract":"

    Undocumented

    ","parent_name":"ValidatorDictionary"},"Structs/ValidatorDictionary.html#/s:FV14SwiftValidator19ValidatorDictionary17removeValueForKeyFPs9AnyObjectS_11Validatable_T_":{"name":"removeValueForKey(_:)","abstract":"

    Undocumented

    ","parent_name":"ValidatorDictionary"},"Structs/ValidatorDictionary.html#/s:vV14SwiftValidator19ValidatorDictionary7isEmptySb":{"name":"isEmpty","abstract":"

    Undocumented

    ","parent_name":"ValidatorDictionary"},"Structs/ValidatorDictionary.html#/s:FPs8Sequence12makeIteratorFT_wx8Iterator":{"name":"makeIterator()","parent_name":"ValidatorDictionary"},"Structs/ValidatorDictionary.html":{"name":"ValidatorDictionary","abstract":"

    Undocumented

    "},"Protocols/ValidationDelegate.html#/s:FP14SwiftValidator18ValidationDelegate20validationSuccessfulFT_T_":{"name":"validationSuccessful()","abstract":"

    This method will be called on delegate object when validation is successful.

    ","parent_name":"ValidationDelegate"},"Protocols/ValidationDelegate.html#/s:FP14SwiftValidator18ValidationDelegate16validationFailedFGSaTPS_11Validatable_CS_15ValidationError__T_":{"name":"validationFailed(_:)","abstract":"

    This method will be called on delegate object when validation fails.

    ","parent_name":"ValidationDelegate"},"Protocols/Validatable.html#/s:vP14SwiftValidator11Validatable14validationTextSS":{"name":"validationText","abstract":"

    Undocumented

    ","parent_name":"Validatable"},"Protocols/Rule.html#/s:FP14SwiftValidator4Rule8validateFSSSb":{"name":"validate(_:)","abstract":"

    Validates text of a field.

    ","parent_name":"Rule"},"Protocols/Rule.html#/s:FP14SwiftValidator4Rule12errorMessageFT_SS":{"name":"errorMessage()","abstract":"

    Displays error message of a field that has failed validation.

    ","parent_name":"Rule"},"Protocols/Rule.html":{"name":"Rule","abstract":"

    The Rule protocol declares the required methods for all objects that subscribe to it.

    "},"Protocols/Validatable.html":{"name":"Validatable","abstract":"

    Undocumented

    "},"Protocols/ValidationDelegate.html":{"name":"ValidationDelegate","abstract":"

    Protocol for ValidationDelegate adherents, which comes with two required methods that are called depending on whether validation succeeded or failed.

    "},"Extensions/UITextField.html#/s:vE14SwiftValidatorCSo11UITextField14validationTextSS":{"name":"validationText","abstract":"

    Undocumented

    ","parent_name":"UITextField"},"Extensions/UITextField.html":{"name":"UITextField","abstract":"

    Undocumented

    "},"Classes/ExactLengthRule.html#/s:FC14SwiftValidator15ExactLengthRulecFT6lengthSi7messageSS_S0_":{"name":"init(length:message:)","abstract":"

    Initializes an ExactLengthRule object to validate the text of a field against an exact length.

    ","parent_name":"ExactLengthRule"},"Classes/ExactLengthRule.html#/s:FC14SwiftValidator15ExactLengthRule8validateFSSSb":{"name":"validate(_:)","abstract":"

    Used to validate a field.

    ","parent_name":"ExactLengthRule"},"Classes/ExactLengthRule.html#/s:FC14SwiftValidator15ExactLengthRule12errorMessageFT_SS":{"name":"errorMessage()","abstract":"

    Displays error message if a field fails validation.

    ","parent_name":"ExactLengthRule"},"Classes/MaxLengthRule.html#/s:FC14SwiftValidator13MaxLengthRulecFT_S0_":{"name":"init()","parent_name":"MaxLengthRule"},"Classes/MaxLengthRule.html#/s:FC14SwiftValidator13MaxLengthRulecFT6lengthSi7messageSS_S0_":{"name":"init(length:message:)","abstract":"

    Initializes a MaxLengthRule object that is to validate the length of the text of a field.

    ","parent_name":"MaxLengthRule"},"Classes/MaxLengthRule.html#/s:FC14SwiftValidator13MaxLengthRule8validateFSSSb":{"name":"validate(_:)","abstract":"

    Used to validate a field.

    ","parent_name":"MaxLengthRule"},"Classes/MaxLengthRule.html#/s:FC14SwiftValidator13MaxLengthRule12errorMessageFT_SS":{"name":"errorMessage()","abstract":"

    Displays an error message if a field fails validation.

    ","parent_name":"MaxLengthRule"},"Classes/MinLengthRule.html#/s:FC14SwiftValidator13MinLengthRulecFT_S0_":{"name":"init()","parent_name":"MinLengthRule"},"Classes/MinLengthRule.html#/s:FC14SwiftValidator13MinLengthRulecFT6lengthSi7messageSS_S0_":{"name":"init(length:message:)","abstract":"

    Initializes a MaxLengthRule object that is to validate the length of the text of a field.

    ","parent_name":"MinLengthRule"},"Classes/MinLengthRule.html#/s:FC14SwiftValidator13MinLengthRule8validateFSSSb":{"name":"validate(_:)","abstract":"

    Validates a field.

    ","parent_name":"MinLengthRule"},"Classes/MinLengthRule.html#/s:FC14SwiftValidator13MinLengthRule12errorMessageFT_SS":{"name":"errorMessage()","abstract":"

    Displays error message when field has failed validation.

    ","parent_name":"MinLengthRule"},"Classes/AlphaRule.html#/s:FC14SwiftValidator9AlphaRulecFT7messageSS_S0_":{"name":"init(message:)","abstract":"

    Initializes an AlphaRule object to verify that a field has valid set of alpha characters.

    ","parent_name":"AlphaRule"},"Classes/IntegerRule.html#/s:FC14SwiftValidator11IntegerRulecFT7messageSS_S0_":{"name":"init(message:)","abstract":"

    Initializes a IntegerRule object to validate that the text of a field is only Integer.

    ","parent_name":"IntegerRule"},"Classes/IntegerRule.html#/s:FC14SwiftValidator11IntegerRule8validateFSSSb":{"name":"validate(_:)","abstract":"

    Used to validate field.

    ","parent_name":"IntegerRule"},"Classes/IntegerRule.html#/s:FC14SwiftValidator11IntegerRule12errorMessageFT_SS":{"name":"errorMessage()","abstract":"

    Displays error message when field fails validation.

    ","parent_name":"IntegerRule"},"Classes/RegexRule.html#/s:FC14SwiftValidator9RegexRulecFT5regexSS7messageSS_S0_":{"name":"init(regex:message:)","abstract":"

    Method used to initialize RegexRule object.

    ","parent_name":"RegexRule"},"Classes/RegexRule.html#/s:FC14SwiftValidator9RegexRule8validateFSSSb":{"name":"validate(_:)","abstract":"

    Method used to validate field.

    ","parent_name":"RegexRule"},"Classes/RegexRule.html#/s:FC14SwiftValidator9RegexRule12errorMessageFT_SS":{"name":"errorMessage()","abstract":"

    Method used to dispaly error message when field fails validation.

    ","parent_name":"RegexRule"},"Classes/RequiredRule.html#/s:FC14SwiftValidator12RequiredRulecFT7messageSS_S0_":{"name":"init(message:)","abstract":"

    Initializes RequiredRule object with error message. Used to validate a field that requires text.

    ","parent_name":"RequiredRule"},"Classes/RequiredRule.html#/s:FC14SwiftValidator12RequiredRule8validateFSSSb":{"name":"validate(_:)","abstract":"

    Validates a field.

    ","parent_name":"RequiredRule"},"Classes/RequiredRule.html#/s:FC14SwiftValidator12RequiredRule12errorMessageFT_SS":{"name":"errorMessage()","abstract":"

    Used to display error message when validation fails.

    ","parent_name":"RequiredRule"},"Classes/ValidationError.html#/s:vC14SwiftValidator15ValidationError5fieldPs9AnyObjectS_11Validatable_":{"name":"field","abstract":"

    the Validatable field of the field

    ","parent_name":"ValidationError"},"Classes/ValidationError.html#/s:vC14SwiftValidator15ValidationError10errorLabelGSqCSo7UILabel_":{"name":"errorLabel","abstract":"

    the error label of the field

    ","parent_name":"ValidationError"},"Classes/ValidationError.html#/s:vC14SwiftValidator15ValidationError12errorMessageSS":{"name":"errorMessage","abstract":"

    the error message of the field

    ","parent_name":"ValidationError"},"Classes/ValidationError.html#/s:FC14SwiftValidator15ValidationErrorcFT5fieldPs9AnyObjectS_11Validatable_10errorLabelGSqCSo7UILabel_5errorSS_S0_":{"name":"init(field:errorLabel:error:)","abstract":"

    Initializes ValidationError object with a field, errorLabel, and errorMessage.

    ","parent_name":"ValidationError"},"Classes/ISBNRule.html#/s:FC14SwiftValidator8ISBNRulecFT7messageSS_S0_":{"name":"init(message:)","abstract":"

    Initializes a ISBNRule object to verify that field has text that is a ISBN number.

    ","parent_name":"ISBNRule"},"Classes/ISBNRule.html#/s:FC14SwiftValidator8ISBNRule8validateFSSSb":{"name":"validate(_:)","abstract":"

    Method used to validate field.

    ","parent_name":"ISBNRule"},"Classes/ISBNRule.html#/s:FC14SwiftValidator8ISBNRule12errorMessageFT_SS":{"name":"errorMessage()","abstract":"

    Method used to dispaly error message when field fails validation.

    ","parent_name":"ISBNRule"},"Classes/IPV4Rule.html#/s:FC14SwiftValidator8IPV4RulecFT7messageSS_S0_":{"name":"init(message:)","abstract":"

    Initializes a IPV4Rule object to verify that field has text is an IPV4Rule address.

    ","parent_name":"IPV4Rule"},"Classes/ConfirmationRule.html#/s:FC14SwiftValidator16ConfirmationRulecFT12confirmFieldPs9AnyObjectS_11Validatable_7messageSS_S0_":{"name":"init(confirmField:message:)","abstract":"

    Initializes a ConfirmationRule object to validate the text of a field that should equal the text of another field.

    ","parent_name":"ConfirmationRule"},"Classes/ConfirmationRule.html#/s:FC14SwiftValidator16ConfirmationRule8validateFSSSb":{"name":"validate(_:)","abstract":"

    Used to validate a field.

    ","parent_name":"ConfirmationRule"},"Classes/ConfirmationRule.html#/s:FC14SwiftValidator16ConfirmationRule12errorMessageFT_SS":{"name":"errorMessage()","abstract":"

    Displays an error message when text field fails validation.

    ","parent_name":"ConfirmationRule"},"Classes/ValidationRule.html#/s:vC14SwiftValidator14ValidationRule5fieldPs9AnyObjectS_11Validatable_":{"name":"field","abstract":"

    the field of the field

    ","parent_name":"ValidationRule"},"Classes/ValidationRule.html#/s:vC14SwiftValidator14ValidationRule10errorLabelGSqCSo7UILabel_":{"name":"errorLabel","abstract":"

    the errorLabel of the field

    ","parent_name":"ValidationRule"},"Classes/ValidationRule.html#/s:vC14SwiftValidator14ValidationRule5rulesGSaPS_4Rule__":{"name":"rules","abstract":"

    the rules of the field

    ","parent_name":"ValidationRule"},"Classes/ValidationRule.html#/s:FC14SwiftValidator14ValidationRulecFT5fieldPs9AnyObjectS_11Validatable_5rulesGSaPS_4Rule__10errorLabelGSqCSo7UILabel__S0_":{"name":"init(field:rules:errorLabel:)","abstract":"

    Initializes ValidationRule instance with field, rules, and errorLabel.

    ","parent_name":"ValidationRule"},"Classes/ValidationRule.html#/s:FC14SwiftValidator14ValidationRule13validateFieldFT_GSqCS_15ValidationError_":{"name":"validateField()","abstract":"

    Used to validate field against its validation rules.

    ","parent_name":"ValidationRule"},"Classes/Validator.html#/s:vC14SwiftValidator9Validator11validationsGVS_19ValidatorDictionaryCS_14ValidationRule_":{"name":"validations","abstract":"

    Dictionary to hold all fields (and accompanying rules) that will undergo validation.

    ","parent_name":"Validator"},"Classes/Validator.html#/s:vC14SwiftValidator9Validator6errorsGVS_19ValidatorDictionaryCS_15ValidationError_":{"name":"errors","abstract":"

    Dictionary to hold fields (and accompanying errors) that were unsuccessfully validated.

    ","parent_name":"Validator"},"Classes/Validator.html#/s:FC14SwiftValidator9ValidatorcFT_S0_":{"name":"init()","parent_name":"Validator"},"Classes/Validator.html#/s:FC14SwiftValidator9Validator13validateFieldFTPs9AnyObjectS_11Validatable_8callbackFGSqCS_15ValidationError_T__T_":{"name":"validateField(_:callback:)","abstract":"

    This method is used to validate a single field registered to Validator. If validation is unsuccessful,","parent_name":"Validator"},"Classes/Validator.html#/s:FC14SwiftValidator9Validator17styleTransformersFT7successGSqFCS_14ValidationRuleT__5errorGSqFCS_15ValidationErrorT___T_":{"name":"styleTransformers(success:error:)","abstract":"

    This method is used to style fields that have undergone validation checks. Success callback should be used to show common success styling and error callback should be used to show common error styling.

    ","parent_name":"Validator"},"Classes/Validator.html#/s:FC14SwiftValidator9Validator13registerFieldFTPs9AnyObjectS_11Validatable_10errorLabelGSqCSo7UILabel_5rulesGSaPS_4Rule___T_":{"name":"registerField(_:errorLabel:rules:)","abstract":"

    This method is used to add a field to validator.

    ","parent_name":"Validator"},"Classes/Validator.html#/s:FC14SwiftValidator9Validator15unregisterFieldFPs9AnyObjectS_11Validatable_T_":{"name":"unregisterField(_:)","abstract":"

    This method is for removing a field validator.

    ","parent_name":"Validator"},"Classes/Validator.html#/s:FC14SwiftValidator9Validator8validateFPS_18ValidationDelegate_T_":{"name":"validate(_:)","abstract":"

    This method checks to see if all fields in validator are valid.

    ","parent_name":"Validator"},"Classes/Validator.html#/s:FC14SwiftValidator9Validator8validateFFGSaTPS_11Validatable_CS_15ValidationError__T_T_":{"name":"validate(_:)","abstract":"

    This method validates all fields in validator and sets any errors to errors parameter of callback.

    ","parent_name":"Validator"},"Classes/HexColorRule.html#/s:FC14SwiftValidator12HexColorRulecFT7messageSS_S0_":{"name":"init(message:)","abstract":"

    Initializes a HexaColorRule object to verify that field has text in hexadecimal color format.

    ","parent_name":"HexColorRule"},"Classes/FloatRule.html#/s:FC14SwiftValidator9FloatRulecFT7messageSS_S0_":{"name":"init(message:)","abstract":"

    Initializes a FloatRule object to validate that the text of a field is a floating point number.

    ","parent_name":"FloatRule"},"Classes/FloatRule.html#/s:FC14SwiftValidator9FloatRule8validateFSSSb":{"name":"validate(_:)","abstract":"

    Used to validate field.

    ","parent_name":"FloatRule"},"Classes/FloatRule.html#/s:FC14SwiftValidator9FloatRule12errorMessageFT_SS":{"name":"errorMessage()","abstract":"

    Displays error message when field fails validation.

    ","parent_name":"FloatRule"},"Classes/PhoneNumberRule.html#/s:FC14SwiftValidator15PhoneNumberRulecFT7messageSS_S0_":{"name":"init(message:)","abstract":"

    Initializes a PhoneNumberRule object. Used to validate that a field has a valid phone number.

    ","parent_name":"PhoneNumberRule"},"Classes/CharacterSetRule.html#/s:FC14SwiftValidator16CharacterSetRulecFT12characterSetV10Foundation12CharacterSet7messageSS_S0_":{"name":"init(characterSet:message:)","abstract":"

    Initializes a CharacterSetRule object to verify that field has valid set of characters.

    ","parent_name":"CharacterSetRule"},"Classes/CharacterSetRule.html#/s:FC14SwiftValidator16CharacterSetRule8validateFSSSb":{"name":"validate(_:)","abstract":"

    Used to validate field.

    ","parent_name":"CharacterSetRule"},"Classes/CharacterSetRule.html#/s:FC14SwiftValidator16CharacterSetRule12errorMessageFT_SS":{"name":"errorMessage()","abstract":"

    Displays error message when field fails validation.

    ","parent_name":"CharacterSetRule"},"Classes/AlphaNumericRule.html#/s:FC14SwiftValidator16AlphaNumericRulecFT7messageSS_S0_":{"name":"init(message:)","abstract":"

    Initializes a AlphaNumericRule object to verify that field has valid set of alphanumeric characters.

    ","parent_name":"AlphaNumericRule"},"Classes/PasswordRule.html#/s:FC14SwiftValidator12PasswordRulecFT7messageSS_S0_":{"name":"init(message:)","abstract":"

    Initializes a PasswordRule object that will validate a field is a valid password.

    ","parent_name":"PasswordRule"},"Classes/ZipCodeRule.html#/s:FC14SwiftValidator11ZipCodeRulecFT7messageSS_S0_":{"name":"init(message:)","abstract":"

    Initializes a ZipCodeRule object.

    ","parent_name":"ZipCodeRule"},"Classes/FullNameRule.html#/s:FC14SwiftValidator12FullNameRulecFT7messageSS_S0_":{"name":"init(message:)","abstract":"

    Initializes a FullNameRule object that is used to verify that text in field is a full name.

    ","parent_name":"FullNameRule"},"Classes/FullNameRule.html#/s:FC14SwiftValidator12FullNameRule8validateFSSSb":{"name":"validate(_:)","abstract":"

    Used to validate a field.

    ","parent_name":"FullNameRule"},"Classes/FullNameRule.html#/s:FC14SwiftValidator12FullNameRule12errorMessageFT_SS":{"name":"errorMessage()","abstract":"

    Used to display error message of a field that has failed validation.

    ","parent_name":"FullNameRule"},"Classes/EmailRule.html#/s:FC14SwiftValidator9EmailRulecFT7messageSS_S0_":{"name":"init(message:)","abstract":"

    Initializes an EmailRule object to validate an email field.

    ","parent_name":"EmailRule"},"Classes/EmailRule.html":{"name":"EmailRule","abstract":"

    EmailRule is a subclass of RegexRule that defines how a email is validated.

    "},"Classes/FullNameRule.html":{"name":"FullNameRule","abstract":"

    FullNameRule is a subclass of Rule that defines how a full name is validated.

    "},"Classes/ZipCodeRule.html":{"name":"ZipCodeRule","abstract":"

    ZipCodeRule is a subclass of RegexRule that represents how zip codes are to be validated.

    "},"Classes/PasswordRule.html":{"name":"PasswordRule","abstract":"

    PasswordRule is a subclass of RegexRule that defines how a password is validated.

    "},"Classes/AlphaNumericRule.html":{"name":"AlphaNumericRule","abstract":"

    AlphaNumericRule is a subclass of CharacterSetRule. It is used to verify that a field has a"},"Classes/CharacterSetRule.html":{"name":"CharacterSetRule","abstract":"

    CharacterSetRule is a subclass of Rule. It is used to validate IPV4 address fields.

    "},"Classes/PhoneNumberRule.html":{"name":"PhoneNumberRule","abstract":"

    PhoneNumberRule is a subclass of Rule that defines how a phone number is validated.

    "},"Classes/FloatRule.html":{"name":"FloatRule","abstract":"

    FloatRule is a subclass of Rule that defines how check if a value is a floating point value.

    "},"Classes/HexColorRule.html":{"name":"HexColorRule","abstract":"

    HexColorRule is a subclass of RegexRule. It is used to verify whether a field is a hexadecimal color.

    "},"Classes/Validator.html":{"name":"Validator","abstract":"

    Class that makes Validator objects. Should be added as a parameter to ViewController that will display"},"Classes/ValidationRule.html":{"name":"ValidationRule","abstract":"

    ValidationRule is a class that creates an object which holds validation info of a field.

    "},"Classes/ConfirmationRule.html":{"name":"ConfirmationRule","abstract":"

    ConfirmationRule is a subclass of Rule that defines how a field that has to be equal"},"Classes/IPV4Rule.html":{"name":"IPV4Rule","abstract":"

    IPV4Rule is a subclass of RegexRule that defines how a IPV4 address validated.

    "},"Classes/ISBNRule.html":{"name":"ISBNRule","abstract":"

    ISBNRule is a subclass of Rule. It is used to verify whether a field is a valid ISBN number.

    "},"Classes/ValidationError.html":{"name":"ValidationError","abstract":"

    The ValidationError class is used for representing errors of a failed validation. It contains the field, error label, and error message of a failed validation.

    "},"Classes/RequiredRule.html":{"name":"RequiredRule","abstract":"

    RequiredRule is a subclass of Rule that defines how a required field is validated.

    "},"Classes/RegexRule.html":{"name":"RegexRule","abstract":"

    RegexRule is a subclass of Rule that defines how a regular expression is validated.

    "},"Classes/IntegerRule.html":{"name":"IntegerRule","abstract":"

    IntegerRule is a subclass of Rule that is used to make sure a the text of a field is an integer.

    "},"Classes/AlphaRule.html":{"name":"AlphaRule","abstract":"

    AlphaRule is a subclass of CharacterSetRule. It is used to verify that a field has a"},"Classes/MinLengthRule.html":{"name":"MinLengthRule","abstract":"

    MinLengthRule is a subclass of Rule that defines how minimum character length is validated.

    "},"Classes/MaxLengthRule.html":{"name":"MaxLengthRule","abstract":"

    MaxLengthRule is a subclass of Rule that defines how maximum character length is validated.

    "},"Classes/ExactLengthRule.html":{"name":"ExactLengthRule","abstract":"

    ExactLengthRule is a subclass of Rule that is used to make sure a the text of a field is an exact length.

    "},"Classes.html":{"name":"Classes","abstract":"

    The following classes are available globally.

    "},"Extensions.html":{"name":"Extensions","abstract":"

    The following extensions are available globally.

    "},"Protocols.html":{"name":"Protocols","abstract":"

    The following protocols are available globally.

    "},"Structs.html":{"name":"Structs","abstract":"

    The following structs are available globally.

    "}} \ No newline at end of file