@@ -34,17 +34,17 @@ Register the fields that you want to validate
3434var fields:[String ] = [" FullName" , " Email" , " Phone" ]
3535
3636// Validation Rules are evaluated from left to right. The first rule is ValidationRuleType.Required the second is ValidationRuleType.FullName.
37- validator.registerField (fields[0 ], textField :nameTextField, rules : [.Required , .FullName ])
38- validator.registerField (fields[1 ], textField :emailTextField, rules : [.Required , .Email ])
39- validator.registerField (fields[2 ], textField :phoneTextField, rules : [.Required , .PhoneNumber ])
37+ validator.registerFieldByKey (fields[0 ], textField :nameTextField, rules : [.Required , .FullName ])
38+ validator.registerFieldByKey (fields[1 ], textField :emailTextField, rules : [.Required , .Email ])
39+ validator.registerFieldByKe (fields[2 ], textField :phoneTextField, rules : [.Required , .PhoneNumber ])
4040
4141```
4242
4343Validate Individual Field
4444
4545``` swift
4646
47- validator.validateFieldBy (fields[0 ], delegate :self )
47+ validator.validateFieldByKey (fields[0 ], delegate :self )
4848
4949// ValidationFieldDelegate methods
5050func validationFieldSuccess (key :String , validField :UITextField){
@@ -61,11 +61,11 @@ Validate All Fields
6161
6262``` swift
6363
64- validator.validateAllBy (fields, delegate :self )
64+ validator.validateAllKeys ( delegate :self )
6565
6666// ValidationDelegate methods
6767
68- func validationWasSuccessful (successfulFields :[ String :ValidationRule] ) {
68+ func validationWasSuccessful () {
6969 // submit the form
7070}
7171
0 commit comments