mirror of
https://github.com/status-im/react-native.git
synced 2025-01-10 09:35:48 +00:00
34b8876ac6
Summary: To help with migration from direct usages of RCTRootView to RCTSurfaceHostingView, RCTSurfaceHostingProxyRootView is added, which is simply a custom impl of RCTSurfaceHostingView, but will all RCTRootView APIs preserved. This makes it easy to do a drop-in replacement in native callsites: ``` // before: RCTRootView *rootView = [[RCTRootView alloc] init...]; // after: RCTRootView *rootView = (RCTRootView *)[[RCTSurfaceHostingProxyRootView alloc] init...]; ``` Reviewed By: shergin Differential Revision: D7141696 fbshipit-source-id: db8c447749eaa896efaa37774a9babef132128eb
66 lines
2.4 KiB
Objective-C
66 lines
2.4 KiB
Objective-C
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#import <UIKit/UIKit.h>
|
|
|
|
#import <React/RCTRootView.h>
|
|
|
|
#import "RCTSurfaceHostingView.h"
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
/**
|
|
* This is a RCTRootView-compatible implementation of RCTSurfaceHostingView.
|
|
* Use this class to replace all usages of RCTRootView in the app for easier migration
|
|
* to RCTSurfaceHostingView.
|
|
*
|
|
* WARNING: In the future, RCTRootView will be deprecated in favor of RCTSurfaceHostingView.
|
|
*/
|
|
@interface RCTSurfaceHostingProxyRootView : RCTSurfaceHostingView
|
|
|
|
#pragma mark RCTRootView compatibility - keep these sync'ed with RCTRootView.h
|
|
|
|
@property (nonatomic, copy, readonly) NSString *moduleName;
|
|
@property (nonatomic, strong, readonly) RCTBridge *bridge;
|
|
@property (nonatomic, copy, readwrite) NSDictionary *appProperties;
|
|
@property (nonatomic, assign) RCTRootViewSizeFlexibility sizeFlexibility;
|
|
@property (nonatomic, weak) id<RCTRootViewDelegate> delegate;
|
|
@property (nonatomic, weak) UIViewController *reactViewController;
|
|
@property (nonatomic, strong, readonly) UIView *contentView;
|
|
@property (nonatomic, strong) UIView *loadingView;
|
|
@property (nonatomic, assign) BOOL passThroughTouches;
|
|
@property (nonatomic, assign) NSTimeInterval loadingViewFadeDelay;
|
|
@property (nonatomic, assign) NSTimeInterval loadingViewFadeDuration;
|
|
@property (nonatomic, assign) BOOL fabric;
|
|
|
|
- (instancetype)initWithBridge:(RCTBridge *)bridge
|
|
moduleName:(NSString *)moduleName
|
|
initialProperties:(NSDictionary *)initialProperties
|
|
fabric:(BOOL)fabric NS_DESIGNATED_INITIALIZER;
|
|
|
|
- (instancetype)initWithBridge:(RCTBridge *)bridge
|
|
moduleName:(NSString *)moduleName
|
|
initialProperties:(NSDictionary *)initialProperties;
|
|
|
|
- (instancetype)initWithBundleURL:(NSURL *)bundleURL
|
|
moduleName:(NSString *)moduleName
|
|
initialProperties:(NSDictionary *)initialProperties
|
|
launchOptions:(NSDictionary *)launchOptions;
|
|
|
|
- (instancetype)initWithBundleURL:(NSURL *)bundleURL
|
|
moduleName:(NSString *)moduleName
|
|
initialProperties:(NSDictionary *)initialProperties
|
|
launchOptions:(NSDictionary *)launchOptions
|
|
fabric:(BOOL)fabric;
|
|
|
|
- (void)cancelTouches;
|
|
|
|
@end
|
|
|
|
NS_ASSUME_NONNULL_END
|
|
|