Code Monkey home page Code Monkey logo

maskedtfpod's Introduction

MaskedTextField

Version License Platform

Delegate for UITextField to work with input mask.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installing with CocoaPods

maskedTextField is available through CocoaPods. To integrate maskedTextField into your Xcode project using CocoaPods, specify it in your podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'maskedTextField'
end

And then run the following comand:

pod install

Masks logic

Description of input mask protocol represented below.

All symbols, which user should enter, must be bracketed with square [] brackets. If symbols are not necesseary, but are needed in mask's callback, they should be surrounded by curly {} brackets. All symbols, which should be presented as is, must be written in mask without any brackets.

There are 6 types of symbols, which you can use into square brackets:

  • '0' - required number. Mask [000] requires to fill 777 for example

  • '9' - optional number. Mask [999] offers to fill 777 for example

  • 'A' - required letter. Mask [AAA] requires to fill abc for example

  • 'a' - required letter. Mask [aaa] offers to fill abc for example

  • '_' - required digit or letter. Mask [00___] offers to fill 78a3b for example

  • '-' - optional difit or letter. Mask [00---] offers to fill 78-6- for example

Examples

There are some examples, which could help you to understand this logic:

  • 7 ([000]) [000] - [0000] - this mask provides you to get 10-digit callback with numbers. Clear result could be between 0000000000 and 9999999999

AltText

  • 7 ([000]) [000] - [9999] - this mask provides you to get 6,7,8,9 or 10-digit callback. Clear result could be between (00000, 999999999)

AltText

  • {7} ([000]) [000] - [9999] - this mask provides you to get 7,8,9,10 or 11-digit callback. Clear result could be between (7000000,79999999999).

AltText

  • (0000)/-(0000)/-(0000)/-(0000) - this mask provides you to get 16-digit callback with numbers. Clear result could be between 0000000000000000 and 9999999999999999.

AltText

  • [____]{A}[-] [999] - this mask provides you to get 5,6,7,8,9 or 10-digit callback. Result could be between aaaaA and }}}}A}99

AltText

Author

iuriigushchin, [email protected]

6epreu, [email protected]

License

maskedTextField is available under the MIT license. See the LICENSE file for more info.

maskedtfpod's People

Contributors

iuriigushchin avatar 6epreu avatar

Stargazers

 avatar Sherzod Khashimov avatar  avatar Carabineiro avatar

Watchers

James Cloos avatar Carabineiro avatar

Forkers

carabina

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.