Skip to content

Commit

Permalink
Call designated initializer for SurfaceHostingProxyRootView (#24368)
Browse files Browse the repository at this point in the history
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 3c125e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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, @"");
Expand Down

0 comments on commit 3c125e8

Please sign in to comment.