From fb58fa1734cc4417658156dbb4b54823b5dc5452 Mon Sep 17 00:00:00 2001 From: Kevin Gozali Date: Tue, 22 Jun 2021 13:28:35 -0700 Subject: [PATCH] iOS: proxy minimumSize to RCTSurface, but as a noop Summary: Previously, RCTRootView added support for minimumSize as a workaround for some initial layout use cases. Going forward, we don't need this anymore. So let's add a proxy property but log an error if anyone calls it. Changelog: [iOS][Changed] - Proxy minimumSize to RCTSurface as a noop Reviewed By: JoshuaGross Differential Revision: D29284227 fbshipit-source-id: 98b2dfc905c6c7e1adc03216e3a1cc3fda0a4133 --- .../RCTSurfaceHostingProxyRootView.h | 1 + .../RCTSurfaceHostingProxyRootView.mm | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.h b/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.h index 59e4bb74753e3b..8e34cd7583c226 100644 --- a/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.h +++ b/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.h @@ -35,6 +35,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, assign) BOOL passThroughTouches; @property (nonatomic, assign) NSTimeInterval loadingViewFadeDelay; @property (nonatomic, assign) NSTimeInterval loadingViewFadeDuration; +@property (nonatomic, assign) CGSize minimumSize; - (instancetype)initWithBridge:(RCTBridge *)bridge moduleName:(NSString *)moduleName diff --git a/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm b/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm index dac29387c41f72..50f4e745fb167e 100644 --- a/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +++ b/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm @@ -61,6 +61,7 @@ - (instancetype)initWithBridge:(RCTBridge *)bridge RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, @"-[RCTSurfaceHostingProxyRootView init]", nil); _bridge = bridge; + _minimumSize = CGSizeZero; if (!bridge.isLoading) { [bridge.performanceLogger markStartForTag:RCTPLTTI]; @@ -172,6 +173,15 @@ - (UIViewController *)reactViewController return _reactViewController ?: [super reactViewController]; } +- (void)setMinimumSize:(CGSize)minimumSize +{ + if (!CGSizeEqualToSize(minimumSize, CGSizeZero)) { + // TODO (T93859532): Investigate implementation for this. + RCTLogError(@"RCTSurfaceHostingProxyRootView does not support changing the deprecated minimumSize"); + } + _minimumSize = CGSizeZero; +} + #pragma mark unsupported - (void)cancelTouches