Skip to content

Commit

Permalink
placeholder text alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
fannt committed Nov 25, 2015
1 parent e1241cf commit be98581
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions Classes/SZTextView.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ IB_DESIGNABLE
@property (nonatomic) IBInspectable double fadeTime;
@property (copy, nonatomic) NSAttributedString *attributedPlaceholder;
@property (retain, nonatomic) UIColor *placeholderTextColor UI_APPEARANCE_SELECTOR;
@property (assign, nonatomic) NSTextAlignment placeholderTextAlignment;

@end
10 changes: 10 additions & 0 deletions Classes/SZTextView.m
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,16 @@ - (UIColor *)placeholderTextColor
return self._placeholderTextView.textColor;
}

- (void)setPlaceholderTextAlignment:(NSTextAlignment)placeholderTextAlignment
{
self._placeholderTextView.textAlignment = self.placeholderTextAlignment;
}

- (NSTextAlignment)placeholderTextAlignment
{
return self._placeholderTextView.textAlignment;
}

- (void)textDidChange:(NSNotification *)aNotification
{
[self setPlaceholderVisibleForText:self.text];
Expand Down

0 comments on commit be98581

Please sign in to comment.