From ff42878a5c4522c5029177d1d1c0ac4de4c04ee8 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Tue, 16 May 2017 09:39:44 -0700 Subject: [PATCH] Introducing `-[RCTUIManager shadowViewForReactTag:]` Reviewed By: javache Differential Revision: D5042093 fbshipit-source-id: 7c154b660f51de6d575f3c4a70321415512e92a2 --- React/Modules/RCTUIManager.h | 5 +++++ React/Modules/RCTUIManager.m | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/React/Modules/RCTUIManager.h b/React/Modules/RCTUIManager.h index ae59a2da5..b94b2db03 100644 --- a/React/Modules/RCTUIManager.h +++ b/React/Modules/RCTUIManager.h @@ -81,6 +81,11 @@ RCT_EXTERN NSString *const RCTUIManagerRootViewKey; */ - (UIView *)viewForReactTag:(NSNumber *)reactTag; +/** + * Gets the shadow view associated with a reactTag. + */ +- (RCTShadowView *)shadowViewForReactTag:(NSNumber *)reactTag; + /** * Set the available size (`availableSize` property) for a root view. * This might be used in response to changes in external layout constraints. diff --git a/React/Modules/RCTUIManager.m b/React/Modules/RCTUIManager.m index 642399575..57f2f0e2b 100644 --- a/React/Modules/RCTUIManager.m +++ b/React/Modules/RCTUIManager.m @@ -409,6 +409,12 @@ BOOL RCTIsUIManagerQueue() return _viewRegistry[reactTag]; } +- (RCTShadowView *)shadowViewForReactTag:(NSNumber *)reactTag +{ + RCTAssertUIManagerQueue(); + return _shadowViewRegistry[reactTag]; +} + - (void)setAvailableSize:(CGSize)availableSize forRootView:(UIView *)rootView { RCTAssertMainQueue();