Skip to content

espeiorin/ESPPlaceholderTextView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESPPlaceholderTextView

======================

Version Platform

UITextView replacement that allows developers to add Placeholder behavior to TextViews without a single line of code:

Installation

ESPPlaceholderTextView is available through CocoaPods, to install it simply add the following line to your Podfile:

pod "ESPPlaceholderTextView"

Using

###How use ESPPlaceholderTextView with Storyboard (Youtube Video)

How to Use ESPPlaceholderTextView in your code

Import Classes

#import <ESPPlaceholderTextView/ESPPlaceholderTextView.h>
#import <ESPPlaceholderTextView/ESPPlaceholderControl.h>

Create ESPPlaceholderTextView instance

self.textView = [[ESPPlaceholderTextView alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 200.0)];
self.textView.placeholder = @"Placeholder";
self.textView.placeholderColor = [UIColor lightGrayColor];

Create ESPPlaceholderControl instance

ESPPlaceholderControl *control = [[ESPPlaceholderControl alloc] init];

Connect both objects

control.owner = self.textView;
self.textView.delegate = control;

BONUS FEATURE

If you need (as always) to delegate UITextViewDelegate's methods for another object, you can assign this object to ESPPlaceholderControl targets.

control.targets = @[self];

They will work without any interference