SSFloatingLabelTextField is a small library for iOS which supports Floating labels and errors with different kind of validations. Also user can add/customise own validation and error messages.
Main Features include :-
All Attributes :-
| Attribute | Description |
| --- | --- |
floatingLabelText | Floating Placeholder label
selectedLabelColor | Color of Floating label when textfield is active
unSelectedLabelColor | Color of Floating label when textfield is active
errorText | Error message when text is not valid
errorTextColor | Color in which error message is shown
type | Set Validation type
customValidationRegex | Set Custom Regex for Validation
isPasswordToggleEnable | Toggle show hide password
showPasswordImage | Toggle image when password is visible
hidePasswordImage | Toggle image when password is visible
- iOS 11.0+ - Xcode 11+
You can use CocoaPods to install
SSFloatingLabelTextField by adding it to your Podfile:
use_frameworks! pod 'SSFloatingLabelTextField'
Import SSFloatingLabelTextField in your file:
- Download and drop **SSFloatingLabelTextField/Sources** folder in your project. - Congratulations!
In the storyboard add a UITextField and change its class to SSFloatingLabelTextField
Set text type in your View Controller file :-
@IBOutlet weak var txtUsername: SSFloatingLabelTextField! // Add IBOutlet txtEmail.type = .email // Assign type as email txtPassword.type = .password(passwordRule: .medium) // Assign type as password txtPhoneNumber.type = .phoneNumber(formatterString: nil) // Assign type as phone number (Params :- Phone number formatter default :- XXX-XXX-XXXX )
Check if given text field is valid or not :-
Support it by joining stargazers for this repository. ⭐
Whether you're helping us fix bugs, improve the docs, or a feature request, we'd love to have you! 💪
Check out our Contributing Guide for ideas on contributing.
For bugs, feature requests, and discussion please use GitHub Issues.