|
@@ -15,6 +15,8 @@
|
15
|
15
|
@property (nonatomic, strong, readwrite) RCTBridge *bridge;
|
16
|
16
|
@property (nonatomic, strong, readwrite) RNNExternalComponentStore *store;
|
17
|
17
|
@property (nonatomic, strong, readwrite) RNNReactComponentRegistry *componentRegistry;
|
|
18
|
+@property (nonatomic, strong, readonly) RNNOverlayManager *overlayManager;
|
|
19
|
+@property (nonatomic, strong, readonly) RNNModalManager *modalManager;
|
18
|
20
|
|
19
|
21
|
@end
|
20
|
22
|
|
|
@@ -37,6 +39,9 @@
|
37
|
39
|
_launchOptions = launchOptions;
|
38
|
40
|
_delegate = delegate;
|
39
|
41
|
|
|
42
|
+ _overlayManager = [RNNOverlayManager new];
|
|
43
|
+ _modalManager = [RNNModalManager new];
|
|
44
|
+
|
40
|
45
|
_store = [RNNExternalComponentStore new];
|
41
|
46
|
_bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:_launchOptions];
|
42
|
47
|
|
|
@@ -85,8 +90,8 @@
|
85
|
90
|
id<RNNComponentViewCreator> rootViewCreator = [[RNNReactRootViewCreator alloc] initWithBridge:bridge];
|
86
|
91
|
_componentRegistry = [[RNNReactComponentRegistry alloc] initWithCreator:rootViewCreator];
|
87
|
92
|
RNNControllerFactory *controllerFactory = [[RNNControllerFactory alloc] initWithRootViewCreator:rootViewCreator eventEmitter:eventEmitter store:_store componentRegistry:_componentRegistry andBridge:bridge];
|
88
|
|
-
|
89
|
|
- _commandsHandler = [[RNNCommandsHandler alloc] initWithControllerFactory:controllerFactory eventEmitter:eventEmitter stackManager:[RNNNavigationStackManager new] modalManager:[RNNModalManager new] overlayManager:[RNNOverlayManager new] mainWindow:_mainWindow];
|
|
93
|
+
|
|
94
|
+ _commandsHandler = [[RNNCommandsHandler alloc] initWithControllerFactory:controllerFactory eventEmitter:eventEmitter stackManager:[RNNNavigationStackManager new] modalManager:_modalManager overlayManager:_overlayManager mainWindow:_mainWindow];
|
90
|
95
|
RNNBridgeModule *bridgeModule = [[RNNBridgeModule alloc] initWithCommandsHandler:_commandsHandler];
|
91
|
96
|
|
92
|
97
|
return [@[bridgeModule,eventEmitter] arrayByAddingObjectsFromArray:[self extraModulesFromDelegate]];
|
|
@@ -104,7 +109,10 @@
|
104
|
109
|
}
|
105
|
110
|
|
106
|
111
|
- (void)onBridgeWillReload {
|
107
|
|
- UIApplication.sharedApplication.delegate.window.rootViewController = nil;
|
|
112
|
+ [_overlayManager dismissAllOverlays];
|
|
113
|
+ [_modalManager dismissAllModalsSynchronosly];
|
|
114
|
+ [_componentRegistry clear];
|
|
115
|
+ UIApplication.sharedApplication.delegate.window.rootViewController = nil;
|
108
|
116
|
}
|
109
|
117
|
|
110
|
118
|
@end
|