Format Text Field While User Enters Data
Posted
by Matt
on Stack Overflow
See other posts from Stack Overflow
or by Matt
Published on 2010-06-16T20:39:56Z
Indexed on
2010/06/16
20:42 UTC
Read the original article
Hit count: 224
Hello, so here is what I am trying to do. I have a birth date text field, while the user in puts text i want the field to automatically put it in the form YYYY-MM-DD. Basically while the user types it replaces the Y's M's and D's but leaves the hyphen. I am not sure how to go about this i may need a mask or something.
I know this is where some of the formatting can be done
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
Any help would be of much help
© Stack Overflow or respective owner