• Stars
    star
    348
  • Rank 121,840 (Top 3 %)
  • Language
    Objective-C
  • Created over 10 years ago
  • Updated over 10 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Simple class to display dynamically masked textFields

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