Skip to content

OmerCora/OCMaskedTextField

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Simple class to display dynamically masked textFields

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published