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
|
5 years ago | |
---|---|---|
.. | ||
ValidationTextField | 5 years ago | |
LICENSE | 5 years ago | |
README.md | 5 years ago |
README.md
ValidationTextField
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
- can change success image, error image
- 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
License
Apache License Version 2.0