diff --git a/AsyncDisplayKit/ASEditableTextNode.h b/AsyncDisplayKit/ASEditableTextNode.h index bef4a0a81b..e343b4b420 100644 --- a/AsyncDisplayKit/ASEditableTextNode.h +++ b/AsyncDisplayKit/ASEditableTextNode.h @@ -19,6 +19,12 @@ #pragma mark - Configuration +/** + @abstract Access to underlying UITextView for more configuration options. + @warning This property should only be used on the main thread and should not be accessed before the editable text node's view is created. + */ +@property (nonatomic, readonly, strong) UITextView *textView; + //! @abstract The attributes to apply to new text being entered by the user. @property (nonatomic, readwrite, strong) NSDictionary *typingAttributes; diff --git a/AsyncDisplayKit/ASEditableTextNode.mm b/AsyncDisplayKit/ASEditableTextNode.mm index 9f51c59619..37196fb2f7 100644 --- a/AsyncDisplayKit/ASEditableTextNode.mm +++ b/AsyncDisplayKit/ASEditableTextNode.mm @@ -134,7 +134,7 @@ [self.view addSubview:_placeholderTextKitComponents.textView]; // Create and configure our text view. - _textKitComponents.textView = [[_ASDisabledPanUITextView alloc] initWithFrame:CGRectZero textContainer:_textKitComponents.textContainer]; + _textKitComponents.textView = self.textView; //_textKitComponents.textView = NO; // Unfortunately there's a bug here with iOS 7 DP5 that causes the text-view to only be one line high when scrollEnabled is NO. rdar://14729288 _textKitComponents.textView.delegate = self; _textKitComponents.textView.editable = YES; @@ -190,6 +190,15 @@ #pragma mark - Configuration @synthesize delegate = _delegate; +- (UITextView *)textView +{ + ASDisplayNodeAssertMainThread(); + if (!_textKitComponents.textView) { + _textKitComponents.textView = [[_ASDisabledPanUITextView alloc] initWithFrame:CGRectZero textContainer:_textKitComponents.textContainer]; + } + return _textKitComponents.textView; +} + #pragma mark - @dynamic typingAttributes;