Tuesday, December 15, 2015

How to insert PlaceHolder in UITextView in iOS


Easy way, just create placeholder text in UITextView by using UITextView+Placeholder this code:-

Just add 'UITextView+Placeholder' files into your project. And import it. And just use following code:

Create UITextView, then set placeholder.
UITextView *textView = [[UITextView alloc] init];
textView.placeholder = @"How are you?";
textView.placeholderColor = [UIColor lightGrayColor]; // optional
Congratulations! You're done.

No comments:

Post a Comment