diff --git a/Libraries/Text/RCTTextView.h b/Libraries/Text/RCTTextView.h index 19f2fea39..014e35315 100644 --- a/Libraries/Text/RCTTextView.h +++ b/Libraries/Text/RCTTextView.h @@ -21,8 +21,10 @@ @property (nonatomic, assign) BOOL selectTextOnFocus; @property (nonatomic, assign) UIEdgeInsets contentInset; @property (nonatomic, assign) BOOL automaticallyAdjustContentInsets; +@property (nonatomic, copy) NSString *text; +@property (nonatomic, strong) UIColor *textColor; @property (nonatomic, strong) UIColor *placeholderTextColor; -@property (nonatomic, assign) UIFont *font; +@property (nonatomic, strong) UIFont *font; - (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; diff --git a/Libraries/Text/RCTTextView.m b/Libraries/Text/RCTTextView.m index c5947f317..fa5b2bf8a 100644 --- a/Libraries/Text/RCTTextView.m +++ b/Libraries/Text/RCTTextView.m @@ -72,13 +72,22 @@ } } +- (UIFont *)font +{ + return _textView.font; +} + - (void)setFont:(UIFont *)font { - _font = font; - _textView.font = _font; + _textView.font = font; [self updatePlaceholder]; } +- (UIColor *)textColor +{ + return _textView.textColor; +} + - (void)setTextColor:(UIColor *)textColor { _textView.textColor = textColor; @@ -106,6 +115,11 @@ [self updateFrames]; } +- (NSString *)text +{ + return _textView.text; +} + - (void)setText:(NSString *)text { if (![text isEqualToString:_textView.text]) { @@ -146,7 +160,6 @@ - (void)textViewDidBeginEditing:(UITextView *)textView { if (_clearTextOnFocus) { - [_textView setText:@""]; _textView.text = @""; [self _setPlaceholderVisibility]; }