Skip to content

mps/MPSPlaceholderTextView

Repository files navigation

MPSPlaceholderTextView

A simple UITextView that allows Placeholder text.

Example

Screenshot

Usage

Xib

You can use MPSPlaceholderTextView in your Xib's as a normal UITextView by overriding the Class from a UITextView control to MPSPlaceholderTextView.

Code

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)];

Customization

@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.

Credits

I have improved this idea over time but I first stumbled across a similar implementation somewhere on the internet.

Contact

License

See LICENSE.

About

A simple UITextView that allows Placeholder text

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published