A resuable custom TextField component in iOS Swift. It is built upon programmatic UI and fully customizable.
- iOS Support
- Demo
- Features
- Getting started
- Usage
- Methods
- Want to Contribute?
- Need Help / Support?
- Collection of Components
- Changelog
- License
- Keywords
Versions iOS 12, iOS 13
We have tested our program in above versions, however you can use it in other versions as well.
- Customisable UITextField with more properties.
- Common class can be used for different textfields based on Type. For e.g. Email TextField, Password TextField, Phone TextField
Download this sample project and import WLITextField file in your project.
Setup process is described below to integrate in project.
- Go to identity inspector and set WLITextField as your textfield class.
- Set your property using Attrubutes inspector in UITextField
- Create IBOutlet of textFieldView and set below propetise base on your requirements
For example
//set delegate
txtUserName.wliDelegate = self
//set keyboard type
txtUserName.keyboardType = .default
//set border
txtUserName.typeBorder = .BottomBorder
//return key to disable keybord or not
txtUserName.returnKeyPressToHideKeybord = true
//allow paste or not
txtUserName.allowPaste = true
//allow to copy or cut from textField
txtUserName.allowCopyCut = true
//set max Character of textField
txtUserName.maxCharacter = 10
//set Allow character to put in textField
txtUserName.allowCharacterOnly = "+0123456789"
Set delegate methods to get call back in your project controller where WLITextfield class is assigned.
func WLITextFieldShouldBeginEditing(_ textField: UITextField) -> Bool
func WLITextFieldDidBeginEditing(_ textField: UITextField)
func WLITextFieldShouldEndEditing(_ textField: UITextField) -> Bool
func WLITextFieldDidEndEditing(_ textField: UITextField)
func WLITextFieldDidEndEditing(_ textField: UITextField, reason: UITextField.DidEndEditingReason)
func WLITextField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String, maxCharacters result: Bool) -> Bool
func WLITextFieldShouldClear(_ textField: UITextField) -> Bool
func WLITextFieldShouldReturn(_ textField: UITextField) -> Bool
- Created something awesome, made this code better, added some functionality, or whatever (this is the hardest part).
- Fork it.
- Create new branch to contribute your changes.
- Commit all your changes to your branch.
- Submit a pull request.
We also provide a free, basic support for all users who want to use this Custom Reusable TextField demo in project. In case you want to customize this Custom TextField to suit your development needs, then feel free to contact our iOS developers.
We have built many other components and free resources for software development in various programming languages. Kindly click here to view our Free Resources for Software Development.
Detailed changes for each release are documented in CHANGELOG.
WLITextField, Reusable Textfield, Customisable Textfield, Customisable Textfield Swift, Custom Swift Textfield, iOS Swift Textfield, weblineindia