Skip to content

Commit

Permalink
Fix bug when setting both placeholder and text at the same time. Than…
Browse files Browse the repository at this point in the history
…ks bahrens!
  • Loading branch information
gcamp committed Aug 21, 2011
1 parent 36b37ad commit 51ecb45
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions Demo/GCPlaceholderTextViewDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@
B0B559EC1361DFFA00A8E980 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0420;
ORGANIZATIONNAME = LittleKiwi;
};
buildConfigurationList = B0B559EF1361DFFA00A8E980 /* Build configuration list for PBXProject "GCPlaceholderTextViewDemo" */;
Expand Down
7 changes: 7 additions & 0 deletions GCPlaceholderTextView/GCPlaceholderTextView.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ - (NSString *) text {
return text;
}

- (void) setText:(NSString *)text {
super.text = text;

if ([text isEqualToString:self.placeholder]) self.textColor = [UIColor lightGrayColor];
else self.textColor = self.realTextColor;
}

- (NSString *) realText {
return [super text];
}
Expand Down

0 comments on commit 51ecb45

Please sign in to comment.