more public access modifiers
This commit is contained in:
parent
56bd39702c
commit
8dafa0f02f
|
|
@ -1,6 +1,6 @@
|
|||
Pod::Spec.new do |s|
|
||||
s.name = "Swift_Validator"
|
||||
s.version = "2.0.2"
|
||||
s.version = "2.0.3"
|
||||
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.2" }
|
||||
s.source = { :git => "https://github.com/asotog/swift-validator.git", :tag => "2.0.3" }
|
||||
s.source_files = "Validator/*.swift"
|
||||
s.frameworks = ['Foundation', 'UIKit']
|
||||
s.requires_arc = true
|
||||
|
|
|
|||
|
|
@ -16,22 +16,22 @@ import UIKit
|
|||
|
||||
public class Validator {
|
||||
// dictionary to handle complex view hierarchies like dynamic tableview cells
|
||||
var errors:[UITextField:ValidationError] = [:]
|
||||
public var errors:[UITextField:ValidationError] = [:]
|
||||
var validations:[UITextField:ValidationRule] = [:]
|
||||
|
||||
public init(){}
|
||||
|
||||
// MARK: Using Keys
|
||||
|
||||
func registerField(textField:UITextField, rules:[Rule]) {
|
||||
public func registerField(textField:UITextField, rules:[Rule]) {
|
||||
validations[textField] = ValidationRule(textField: textField, rules: rules, errorLabel: nil)
|
||||
}
|
||||
|
||||
func registerField(textField:UITextField, errorLabel:UILabel, rules:[Rule]) {
|
||||
public func registerField(textField:UITextField, errorLabel:UILabel, rules:[Rule]) {
|
||||
validations[textField] = ValidationRule(textField: textField, rules:rules, errorLabel:errorLabel)
|
||||
}
|
||||
|
||||
func validateAll(delegate:ValidationDelegate) {
|
||||
public func validateAll(delegate:ValidationDelegate) {
|
||||
|
||||
for field in validations.keys {
|
||||
if let currentRule:ValidationRule = validations[field] {
|
||||
|
|
|
|||
Loading…
Reference in New Issue