From be98581965fa5d5210ea413b2ce1fccc1fa9ef70 Mon Sep 17 00:00:00 2001 From: Anton Filatov Date: Wed, 25 Nov 2015 18:55:14 +0200 Subject: [PATCH] placeholder text alignment --- Classes/SZTextView.h | 1 + Classes/SZTextView.m | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/Classes/SZTextView.h b/Classes/SZTextView.h index 6bf3c0c..733833e 100644 --- a/Classes/SZTextView.h +++ b/Classes/SZTextView.h @@ -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 diff --git a/Classes/SZTextView.m b/Classes/SZTextView.m index 5e61165..e7ee434 100755 --- a/Classes/SZTextView.m +++ b/Classes/SZTextView.m @@ -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];