2

There seem to be many, albeit, cumbersome ways to add a placeholder to a UITextView created programmatically.

Are there any ways to add one to a UITextView created in Storyboards?

I have lots of these in storyboards and would rather not have to recreate them all in code.

Thanks for any suggestions.

Community
  • 1
  • 1
user1904273
  • 4,562
  • 11
  • 45
  • 96
  • there are two ways: first, you can add a label overlay uitextView, but you also need to change the label's visibility when textView's content changes. another way, you can implement your own textView, and have a placeholder property. then you can set the property at User Defined Runtime Attributes(but the storyboard preview won't show this) – SolaWing Mar 22 '15 at 02:23
  • is the code for this posted anywhere? Where would I place the needed methods. In view did load? Or if there is a textview in the storyboard how would I get the controller to know anything about it? – user1904273 Mar 22 '15 at 02:38
  • in the first way, you can watch textView's content changes at `textViewDidChange` delegate method. – SolaWing Mar 22 '15 at 03:13
  • duplicate with [placeholder in uitextview](http://stackoverflow.com/questions/1328638/placeholder-in-uitextview) – SolaWing Mar 22 '15 at 05:14

0 Answers0