Possible Duplicate:
Placeholder in UITextView
I am relatively new to iOS and I don’t know how to call this in english, but I want to create some UITextViews that contain instructions or pre filled text, like “type your name here”, or “type your phone”, etc, written in light color text but when the user selected the text view to start typing the hints they contain vanish.
Is there any example/tutorial etc. I can follow to learn more about it?
How do I do that in iOS?
There are many ways to do this.
Approach #1:
UITextView does not have a property for placeholder so you’d have to set the text property to the instructions you would like to have and then as soon as the user taps the UITextView clear it out.
Approach #2
There is a subclass of UITextView that someone made that adds a Placeholder property