Question

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!

Was it helpful?

Solution

First Answer :

Go with UIDatePicker.


Second Answer:

UITextField format in xx-xx-xxx

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top