You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
james 41e97e7f42 update ValidateTextField 5 years ago
..
ValidationTextField update ValidateTextField 5 years ago
LICENSE change ValidateTextField as CocoaPods's ValidateTextField 5 years ago
README.md change AddAccount 5 years ago

README.md

ValidationTextField

CI Status Version Platform

A UITextField that easy validate text of UITextField

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

  • demo.gif

Demo 

  • can change success image, error image

Demo 

  • sample code
@IBOutlet weak var nameTextField: ValidationTextField!
@IBOutlet weak var passwordTextField: ValidationTextField!
@IBOutlet weak var passwordConfirmTextField: ValidationTextField!
@IBOutlet weak var emailTextField: ValidationTextField!

override func viewDidLoad() {
  super.viewDidLoad()
  nameTextField.validCondition = {$0.count > 5}
  emailTextField.validCondition = {$0.count > 5 && $0.contains("@")}
  passwordTextField.validCondition = {$0.count > 8}
  passwordConfirmTextField.validCondition = {
    guard let password = self.passwordTextField.text else {
      return false
    }
    return $0 == password
  }

}

Installation

ValidationTextField is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'ValidationTextField'

Author

devikkim@gmail.com

License

Apache License Version 2.0