From 4097459dc9d53013f30e2fe68206f69a45d635ac Mon Sep 17 00:00:00 2001 From: Alex Akers Date: Fri, 29 May 2015 06:04:05 -0700 Subject: [PATCH] [React Native] Remove layout-only nodes from RCTText in RN OSS --- Libraries/Text/RCTText.m | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Libraries/Text/RCTText.m b/Libraries/Text/RCTText.m index 43a926551..1ae432d90 100644 --- a/Libraries/Text/RCTText.m +++ b/Libraries/Text/RCTText.m @@ -16,12 +16,14 @@ @implementation RCTText { NSTextStorage *_textStorage; + NSMutableArray *_reactSubviews; } - (instancetype)initWithFrame:(CGRect)frame { if ((self = [super initWithFrame:frame])) { _textStorage = [[NSTextStorage alloc] init]; + _reactSubviews = [NSMutableArray array]; self.isAccessibilityElement = YES; self.accessibilityTraits |= UIAccessibilityTraitStaticText; @@ -41,6 +43,21 @@ }]; } +- (void)insertReactSubview:(UIView *)subview atIndex:(NSInteger)atIndex +{ + [_reactSubviews insertObject:subview atIndex:atIndex]; +} + +- (void)removeReactSubview:(UIView *)subview +{ + [_reactSubviews removeObject:subview]; +} + +- (NSMutableArray *)reactSubviews +{ + return _reactSubviews; +} + - (void)setTextStorage:(NSTextStorage *)textStorage { _textStorage = textStorage;