Simple class to display dynamically masked textFields
Objective-C
Latest commit bd58ccd May 27, 2014 @OmerCora Auto Keyboard Type For Number Pad
Full numeric masks now sets the keyboardType as number pad while
setting a new mask or in init method.

README.md

OCMaskedTextField

Simple class to display dynamically masked textFields

SeeSampleProject

Usage

To use OCMaskedTextFieldView, simply initialize the view with the desired format/mask string.


OCMaskedTextFieldView *textField = [[OCMaskedTextFieldView alloc]
                                        initWithFrame:CGRectMake(20, 94, 280, 33)
                                        andMask:@"TR - #### #### #### #### #### ####"
                                        showMask:YES];

Default mask supports 3 character sets and is expandable. Hardcoded values are also supported on the masks.

//Default special mask characters:
'#' : Numeric Values
'&' : Alphanumeric Values
'?' : Letter Values

Sample Mask Strings,

//IBAN: @"TR - #### #### #### #### #### ####"

//Phone Number: @"+90 (###) ### ## ##"

//Serial Number: @"[&&&&]-[&&&&]-[&&&&]-[&&&&]"

// Name: @"Mr/Mrs. ?????????????"

Blank values can also be set manually for each speacial character. (default is "_")

[textField setNumericBlank:@"  " alphanumericBlank:@"  " letterBlank:@"  "];
[textField showMask];

License

Licensed under the Apache License, Version 2.0 See Details: http://www.apache.org/licenses/LICENSE-2.0.html