Frage

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!

War es hilfreich?

Lösung

First Answer :

Go with UIDatePicker.


Second Answer:

UITextField format in xx-xx-xxx

Andere Tipps

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top