-
Add Toast.swift file in project.
-
Add Validator.swift file in project.
-
Set HSTextField class in storyboard for your UITextField
-
Refer below code to set validation of UITextField
func setValidation(){ txtEmail.setValidation(Type: .Email) txtPassword.setValidation(Type: .Password, message: "Custom message if required") } -
To validate all textfield use below method
@IBAction func btnLoginTap(){ if self.view.ValidateAllTextField(){ print("Validate successfully.") } }
IMHitesh/TextFieldValidator
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|