Giter Site home page Giter Site logo

lfap / swiftmasktext Goto Github PK

View Code? Open in Web Editor NEW

This project forked from moraisandre/swiftmasktext

0.0 0.0 0.0 942 KB

Another Swift plugin that allows add mask to UITextField

Home Page: http://moraisandre.com/swiftmasktext

License: MIT License

Ruby 11.10% Swift 87.14% Objective-C 1.75%

swiftmasktext's Introduction

Release GitHub issues GitHub license GitHub stars GitHub forks

Carthage Compatible Pod Compatible

SwiftMaskText

Another Swift plugin that allow add mask to UITextField

App Preview

Why to use it?

  • Because it's simples and fast
  • Configuration is through Settings Panel
  • Works with Swift 4.2

Mask Configuration

Mask Symbols

Characters Format
N Number only [0-9]
C Characters [A-Z] (Always upper case)
c Characters [a-z] (Always lower case)
X Characters [a-Z]
U Characters + Numbers [A-Z] + [0-9] (Always upper case)
u Characters + Numbers [a-z] + [0-9] (Always lower case)
% Characters + Numbers [a-Z] + [0-9]
* Any character (Including special ones)

Some examples

Internacional examples

Field Mask
SSN NNN-NN-NNNN
Telephone +NN (NNN) NNN-NNNN
Credit Card NNNN-NNNN-NNNN-NNNN

Brazilian examples

Field Mask
Telephone +NN (0NN) NNNNN-NNNN
CPF NNN.NNN.NNN-NN
RG NN.NNN.NNN-%
CEP NNNNN-NNN

How to use it?

Using Carthage

github "moraisandre/SwiftMaskText"

Using CocoaPods

pod 'SwiftMaskText'

Copy files to your project

  1. Add the SwiftMaskField folder to your project, it contains 2 files. Be sure that 'Copy items if needed' is checked. Copy Items If Needed

  2. In your ViewController add an UITextField object. In 'Settings Panel' -> 'Identity inspector' set Class to 'SwiftMaskField' Custom Class

  3. Now go into 'Settings Panel' -> 'Attributes inspector' and set the Mask that you want it to Swift Mask Field

  4. Done!

More info

Author

André Morais

Website: moraisandre.com/swiftmasktext

E-mail: [email protected]

License

Under the MIT license.

swiftmasktext's People

Contributors

moraisandre avatar andre991 avatar rafaelgali-dextra avatar

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.