An elegant and simple way to add a dedicated UITextField for Password input fields. EyePasswordTextField applies custom features that are intutive and core to a password type of textField.
Requirements to use this library are.
- Minimum deployment target of App should be
iOS 11.0or above. - Supported Swift version should be
Swift 5. CocoaPods 1.10.1, to update use:sudo gem install cocoapods
EyePasswordTextField is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod'EyePasswordTextField'Features provided by EyePasswordTextField are:
Toggle the
defaulteye button to show or hide the password.Add your custom icon to toggle button. (Recommended icon size - 25px X 25px)
letpasswordTextField=EyePasswordTextField() passwordTextField.showPasswordIcon = // Custom UIImage to be visible when password is not visible. passwordTextField.hidePasswordIcon = // Custom UIImage to be visible when password is visible.
Customize the tint of your toogle icon button.
letpasswordTextField=EyePasswordTextField() passwordTextField.tintColor = // Your custom UIColor.
EyePasswordTextFieldprovides custom delegation protocolEyePasswordFieldDelegate.Add your custom password creation rules by adding them to the
PasswordRulestuct.letpasswordTextField=EyePasswordTextField() passwordTextField.passwordRule =PasswordRule( minLength:8, // Minimum password length maxLength:20, // Maximum password length hasNumbers:true, // If password should have numbers. hasUppercase:false, // If password should have upper case letters. hasSpecialCharacters:true, // If password should have a special character. allowedCharacters:[String]=["@","_","-"] // A list of allowed special characters. )
Validates and informs if the entered password is
valid.letpasswordTextField=EyePasswordTextField() passwordTextField.isPasswordValid
To see and run the example project, clone the repo, and run pod install from the Example directory first.
- Fork repository. ✌️
- Add your feature 😎 or fix a 🐛.
- Raise a pull request. 🤓
Ayush Singhi, ayusinghi96@gmail.com
EyePasswordTextField is available under the MIT license. See the LICENSE file for more info.