Skip to content
Permalink
Browse files

Call designated initializer for SurfaceHostingProxyRootView (#24368)

Summary:
1. Call designated initializer for SurfaceHostingProxyRootView.
2. Make super class designated initializer `-initWithSurface:sizeMeasureMode:` `NS_UNAVAILABLE`.

cc. shergin

[iOS] [Fixed] - Call designated initializer for SurfaceHostingProxyRootView
Pull Request resolved: #24368

Differential Revision: D15144991

Pulled By: shergin

fbshipit-source-id: c999ac64c766242ceff157b0d9600190c1f3add8
  • Loading branch information...
zhongwuzw authored and facebook-github-bot committed Apr 30, 2019
1 parent a0523da commit 3c125e867f52efd7f18b2bd8c9a21b246afcd788
@@ -45,6 +45,10 @@ NS_ASSUME_NONNULL_BEGIN
initialProperties:(NSDictionary *)initialProperties
launchOptions:(NSDictionary *)launchOptions;

- (instancetype)initWithSurface:(RCTSurface *)surface
sizeMeasureMode:(RCTSurfaceSizeMeasureMode)sizeMeasureMode
NS_UNAVAILABLE;

- (void)cancelTouches;

@end
@@ -67,9 +67,10 @@ - (instancetype)initWithBridge:(RCTBridge *)bridge
// `RCTRootViewSizeFlexibilityNone` is the RCTRootView's default.
RCTSurfaceSizeMeasureMode sizeMeasureMode = convertToSurfaceSizeMeasureMode(RCTRootViewSizeFlexibilityNone);

if (self = [super initWithBridge:bridge moduleName:moduleName initialProperties:initialProperties sizeMeasureMode:sizeMeasureMode]) {
RCTSurface *surface = [[self class] createSurfaceWithBridge:bridge moduleName:moduleName initialProperties:initialProperties];
[surface start];
if (self = [super initWithSurface:surface sizeMeasureMode:sizeMeasureMode]) {
self.backgroundColor = [UIColor whiteColor];
[super.surface start];
}

RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @"");

0 comments on commit 3c125e8

Please sign in to comment.
You can’t perform that action at this time.