Skip to content

Commit ae64d62

Browse files
removed color feature
1 parent 4c7462e commit ae64d62

File tree

3 files changed

+1
-14
lines changed

3 files changed

+1
-14
lines changed

Validator/Validator.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ public class Validator {
1919
public var errors:[UITextField:ValidationError] = [:]
2020
public var validations:[UITextField:ValidationRule] = [:]
2121
public var shouldMarkTextFieldsInError:Bool = false
22-
public var textFieldErrorColor:UIColor = UIColor.redColor()
2322

2423
public init(){}
2524

@@ -39,7 +38,7 @@ public class Validator {
3938
}
4039

4140
private func markTextFieldAsInError(field:UITextField) {
42-
field.layer.borderColor = self.textFieldErrorColor.CGColor
41+
field.layer.borderColor = UIColor.redColor().CGColor
4342
field.layer.borderWidth = 1.0
4443
}
4544

Validator/ViewController.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ class ViewController: UIViewController , ValidationDelegate, UITextFieldDelegate
3838
validator.registerField(emailConfirmTextField, errorLabel: emailConfirmErrorLabel, rules: [RequiredRule(), ConfirmationRule(confirmField: emailTextField)])
3939
validator.registerField(phoneNumberTextField, errorLabel: phoneNumberErrorLabel, rules: [RequiredRule(), MinLengthRule(length: 9)])
4040
validator.registerField(zipcodeTextField, errorLabel: zipcodeErrorLabel, rules: [RequiredRule(), ZipCodeRule()])
41-
4241
}
4342

4443
@IBAction func submitTapped(sender: AnyObject) {

ValidatorTests/ValidatorTests.swift

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -240,15 +240,4 @@ class ValidatorTests: XCTestCase {
240240
}
241241
}
242242
}
243-
244-
func testTextFieldBorderColorSet() {
245-
REGISTER_VALIDATOR.registerField(REGISTER_TXT_FIELD, errorLabel: ERROR_LABEL, rules: [EmailRule()])
246-
REGISTER_TXT_FIELD.text = INVALID_EMAIL
247-
REGISTER_VALIDATOR.textFieldErrorColor = GREEN_COLOR
248-
REGISTER_VALIDATOR.shouldMarkTextFieldsInError = true
249-
REGISTER_VALIDATOR.validate { (errors) -> Void in
250-
XCTAssert(errors.count == 1, "Should come back with errors")
251-
XCTAssert(CGColorEqualToColor(self.REGISTER_TXT_FIELD.layer.borderColor, self.GREEN_COLOR.CGColor), "Color should be what it was set as")
252-
}
253-
}
254243
}

0 commit comments

Comments
 (0)