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;