podspec updated and more updates

This commit is contained in:
alejandro soto 2015-03-30 20:54:26 -06:00
parent e10bdb3064
commit b216f7b411
4 changed files with 10 additions and 10 deletions

View File

@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Swift_Validator"
s.version = "2.0.4"
s.version = "2.0.5"
s.summary = "A UITextField Validation library for Swift"
s.homepage = "https://github.com/jpotts18/swift-validator"
s.screenshots = "https://raw.githubusercontent.com/jpotts18/swift-validator/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/asotog/swift-validator.git", :tag => "2.0.4" }
s.source = { :git => "https://github.com/asotog/swift-validator.git", :tag => "2.0.5" }
s.source_files = "Validator/*.swift"
s.frameworks = ['Foundation', 'UIKit']
s.requires_arc = true

View File

@ -10,9 +10,9 @@ import Foundation
import UIKit
public class ValidationError {
let textField:UITextField
var errorLabel:UILabel?
let errorMessage:String
public let textField:UITextField
public var errorLabel:UILabel?
public let errorMessage:String
public init(textField:UITextField, error:String){
self.textField = textField

View File

@ -10,9 +10,9 @@ import Foundation
import UIKit
public class ValidationRule {
var textField:UITextField
var errorLabel:UILabel?
var rules:[Rule] = []
public var textField:UITextField
public var errorLabel:UILabel?
public var rules:[Rule] = []
public init(textField: UITextField, rules:[Rule], errorLabel:UILabel?){
self.textField = textField
@ -20,7 +20,7 @@ public class ValidationRule {
self.rules = rules
}
func validateField() -> ValidationError? {
public func validateField() -> ValidationError? {
for rule in rules {
var isValid:Bool = rule.validate(textField.text)
if !isValid {

View File

@ -17,7 +17,7 @@ import UIKit
public class Validator {
// dictionary to handle complex view hierarchies like dynamic tableview cells
public var errors:[UITextField:ValidationError] = [:]
var validations:[UITextField:ValidationRule] = [:]
public var validations:[UITextField:ValidationRule] = [:]
public init(){}