4.0.0 podspec and readme update

This commit is contained in:
Deniz Adalar 2016-06-03 16:42:55 +03:00
parent db6be7b53c
commit 5abb05a423
2 changed files with 7 additions and 5 deletions

View File

@ -102,11 +102,13 @@ func validationSuccessful() {
// 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
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
}

View File

@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SwiftValidator"
s.version = "3.0.1"
s.version = "4.0.0"
s.summary = "A UITextField Validation library for Swift"
s.homepage = "https://github.com/jpotts18/SwiftValidator"
s.screenshots = "https://raw.githubusercontent.com/jpotts18/SwiftValidator/master/swift-validator-v2.gif"
@ -9,7 +9,7 @@ Pod::Spec.new do |s|
s.social_media_url = "http://twitter.com/jpotts18"
s.platform = :ios
s.ios.deployment_target = '8.0'
s.source = { :git => "https://github.com/jpotts18/SwiftValidator.git", :tag => "3.0.1" }
s.source = { :git => "https://github.com/jpotts18/SwiftValidator.git", :tag => "4.0.0" }
s.source_files = "SwiftValidator/**/*.swift"
s.exclude_files = "Validator/AppDelegate.swift"
s.frameworks = ['Foundation', 'UIKit']