Skip to content

Commit

Permalink
added watch validation
Browse files Browse the repository at this point in the history
  • Loading branch information
gkaimakas committed Dec 4, 2015
1 parent 5dcf9b0 commit 437c32e
Show file tree
Hide file tree
Showing 8 changed files with 133 additions and 89 deletions.
184 changes: 114 additions & 70 deletions .idea/workspace.xml

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions README.md
Expand Up @@ -121,6 +121,7 @@ isUppercase|checks if has only uppercase letter|var|-|Validator.isUppercase("ABC
maxLength|checks if the length does not exceed the max length|func|Int|Validator.maxLength(2)("ab")
minLength|checks if the length isn't lower than|func|Int|Validator.minLength(1)("213")
required|checks if it is not an empty string|var|-|Validator.required("")
watch| check the delegate for equality | func | ValidatorProtocol | Validator.watch(delegate)

*FQDNOptions is a class that is used on isFQDN for configuration purposes. It can be instantiated like this:

Expand Down
2 changes: 1 addition & 1 deletion SwiftValidators.podspec
@@ -1,7 +1,7 @@

Pod::Spec.new do |s|
s.name = "SwiftValidators"
s.version = "2.0.2"
s.version = "2.0.3"
s.summary = "String validation for iOS developed in Swift. Inspired by validator.js"
s.homepage = "https://github.com/gkaimakas/SwiftValidators"
s.license = 'MIT'
Expand Down
Binary file not shown.
5 changes: 2 additions & 3 deletions SwiftValidators/Validator.swift
Expand Up @@ -11,7 +11,7 @@ import Foundation
public typealias Validation = (String) -> Bool

public protocol ValidatorProtocol {
func getValue() -> String
func value() -> String
}

public class Validator {
Expand Down Expand Up @@ -1186,12 +1186,11 @@ public class Validator {
if value == "" {
return (self.validationMode == .Default ? true : false)
}
return value == delegate.getValue()
return value == delegate.value()
}
}



// ------------------------ //
// ------------------------ //
// ------------------------ //
Expand Down

0 comments on commit 437c32e

Please sign in to comment.