A simple UITextView that allows Placeholder text.
You can use MPSPlaceholderTextView in your Xib's as a normal UITextView by overriding the Class from a UITextView control to MPSPlaceholderTextView.
Just like you would init a UITextView, you can do the same for MPSPlaceholderTextView.
MPSPlaceholderTextView *placeholder = [[MPSPlaceholderTextView alloc] initWithFrame:CGRectMake(20.0f, 20.0f, 200.0f, 80.0f)];
@property (nonatomic, strong) NSString *placeholder;
Your placeholder text.
@property (nonatomic, strong) UIColor *placeholderColor;
The color you want your placeholder text to be.
@property (nonatomic, strong) UILabel *placeHolderLabel;
If you do not want to take the given UILabel for the Placeholder, you can setup your own here.
I have improved this idea over time but I first stumbled across a similar implementation somewhere on the internet.
- @strickland on Twitter
- @mps on Github
- [email protected]
- http://mstrick.com My Blog
See LICENSE.