Skip to content
Browse files

Rename `-[SSTextView placeholderColor]` to `-[SSTextView placeholderT…

…extColor]`

This is more consistent with SSTextField
  • Loading branch information...
1 parent e1e4617 commit 287a78804972c1c4ce41d9e2771e4beb63764a16 @soffes soffes committed May 30, 2012
Showing with 5 additions and 5 deletions.
  1. +1 −1 SSToolkit/SSTextView.h
  2. +4 −4 SSToolkit/SSTextView.m
View
2 SSToolkit/SSTextView.h
@@ -23,6 +23,6 @@
The default is `[UIColor lightGrayColor]`.
*/
-@property (nonatomic, strong) UIColor *placeholderColor;
+@property (nonatomic, strong) UIColor *placeholderTextColor;
@end
View
8 SSToolkit/SSTextView.m
@@ -23,7 +23,7 @@ @implementation SSTextView {
#pragma mark - Accessors
@synthesize placeholder = _placeholder;
-@synthesize placeholderColor = _placeholderColor;
+@synthesize placeholderTextColor = _placeholderTextColor;
- (void)setText:(NSString *)string {
[super setText:string];
@@ -70,7 +70,7 @@ - (void)drawRect:(CGRect)rect {
[super drawRect:rect];
if (_shouldDrawPlaceholder) {
- [_placeholderColor set];
+ [_placeholderTextColor set];
[_placeholder drawInRect:CGRectMake(8.0f, 8.0f, self.frame.size.width - 16.0f, self.frame.size.height - 16.0f) withFont:self.font];
}
}
@@ -81,14 +81,14 @@ - (void)drawRect:(CGRect)rect {
- (void)_initialize {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_textChanged:) name:UITextViewTextDidChangeNotification object:self];
- self.placeholderColor = [UIColor colorWithWhite:0.702f alpha:1.0f];
+ self.placeholderTextColor = [UIColor colorWithWhite:0.702f alpha:1.0f];
_shouldDrawPlaceholder = NO;
}
- (void)_updateShouldDrawPlaceholder {
BOOL prev = _shouldDrawPlaceholder;
- _shouldDrawPlaceholder = self.placeholder && self.placeholderColor && self.text.length == 0;
+ _shouldDrawPlaceholder = self.placeholder && self.placeholderTextColor && self.text.length == 0;
if (prev != _shouldDrawPlaceholder) {
[self setNeedsDisplay];

0 comments on commit 287a788

Please sign in to comment.
Something went wrong with that request. Please try again.