Giter Club home page Giter Club logo

t4textfieldvalidator's Introduction

T4TextFieldValidator

Rewrite Dhawaldawar's TextFieldValidator library to Swift language

A lightweight, customizable subclass of UITextField that supports multiple regex validations and provides a simple UI to provide validation feedback.

Dhawaldawar has written a great libray, which is named TextFieldValidator at https://github.com/dhawaldawar/TextFieldValidator

He doesn't seem to update his repository from a year ago. So this library is still a objective-C library. We can also use this by using bridged-header file, but it's more better if we use this library in Swift language.

See his description at his blog, and from thinkotech with more example and how to use.

How to use (basic):

  • Download and import the T4TextFieldValidator.swift file to anywhere in your project
  • Add the icon_error to your Assets.xcassets
  • Use custom class T4TextFieldValidator instead the default UITextField
  • Assign a view to presentInView data member of T4TextFieldValidator class on which you want to show error popup. If you are managing text field from storyboard/xib then you can directly assign outlet of “presentInView” to any view.
  • Assign delegate of the text field
  • Add regex to validate
  • Call validate method when you need to validate the text field

For more information and detail, visit this post. Or, you can see my demo, with some textfield type such as email, phone number, password...

Thank you, Dhawaldawar

t4textfieldvalidator's People

Contributors

thanhtanh avatar

Stargazers

 avatar Ky Nguyen avatar  avatar

Watchers

James Cloos avatar  avatar

Forkers

omarps

t4textfieldvalidator's Issues

TextField Delegate

After using T4textfieldvalidator as the custom class for textfield, TextfieldDelegates are not called.

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.