Code Monkey home page Code Monkey logo

ios-custom-textfield's Introduction

iOS Custom TextField

A resuable custom TextField component in iOS Swift. It is built upon programmatic UI and fully customizable.

Table of contents


iOS Support

Versions iOS 12, iOS 13

We have tested our program in above versions, however you can use it in other versions as well.


Demo


Features

  • 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

Getting started

Download this sample project and import WLITextField file in your project.


Usage

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"

Methods

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

Want to Contribute?

  • 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.

Need Help?

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.


Collection of Components

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.


Changelog

Detailed changes for each release are documented in CHANGELOG.

License

MIT

Keywords

WLITextField, Reusable Textfield, Customisable Textfield, Customisable Textfield Swift, Custom Swift Textfield, iOS Swift Textfield, weblineindia

ios-custom-textfield's People

Contributors

partners-wli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

angeloffury7

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.