1

I have a UITextfield set up where users can fill in their date of birth in mm-dd-yyyy. But what I want is when the user fills in their date of birth that it replaces the m,d or y character with the number. Is this possible?

Thanks!

rmaddy
  • 314,917
  • 42
  • 532
  • 579
user1470265
  • 143
  • 1
  • 9

2 Answers2

1

First Answer :

Go with UIDatePicker.


Second Answer:

UITextField format in xx-xx-xxx

Community
  • 1
  • 1
Anoop Vaidya
  • 46,283
  • 15
  • 111
  • 140
0

I think you want a placeholder "mm-dd-yyyy" which does not - as usual, hide when starting to type but hides letter for letter? I think this isn't how iOS works (anyhow you should use NSDatePicker), but if you have a reason why you do so you can use an UITextfield with an NSAttributedString (because of placeholder color) and update it accordingly to input events.

iCaramba
  • 2,589
  • 16
  • 31