1010#import " RNNReactRootViewCreator.h"
1111#import " RNNTurboCommandsHandler.h"
1212#import < React-RuntimeApple/ReactCommon/RCTHost.h>
13-
13+ # import " RNNSplashScreenViewController.h "
1414
1515@interface RNNTurboManager ()
1616@property (nonatomic , strong , readwrite ) RNNExternalComponentStore *store;
@@ -25,13 +25,11 @@ @interface RNNTurboManager ()
2525
2626@implementation RNNTurboManager {
2727 UIWindow *_mainWindow;
28- BOOL _isInitialRun;
2928}
3029
3130- (instancetype )initWithHost : (RCTHost *)host mainWindow : (UIWindow *)mainWindow {
3231 if (self = [super init ]) {
33- _isInitialRun = YES ;
34- _host = host;
32+ _host = host;
3533 _mainWindow = mainWindow;
3634 _overlayManager = [RNNOverlayManager new ];
3735 _store = [RNNExternalComponentStore new ];
@@ -41,11 +39,6 @@ - (instancetype)initWithHost:(RCTHost *)host mainWindow:(UIWindow *)mainWindow {
4139 name: @" RCTInstanceDidLoadBundle"
4240 object: nil ];
4341
44- [[NSNotificationCenter defaultCenter ] addObserver: self
45- selector: @selector (onReload )
46- name: @" RCTTriggerReloadCommandNotification"
47- object: nil ];
48-
4942 // TODO: investigate which new event is fired
5043 [[NSNotificationCenter defaultCenter ] addObserver: self
5144 selector: @selector (onJavaScriptWillLoad )
@@ -106,12 +99,7 @@ - (void)onJavaScriptWillLoad {
10699
107100- (void )onJavaScriptLoaded {
108101 RCTExecuteOnMainQueue (^{
109- // TODO: the isInitialRun is the right and final answer for this, this will stop a blackscreen appearing after the splashscreen on startup. OnReload this will still happen because of the rootViewController = nil; which is needed to clean up what is already appearing.
110- if (!self->_isInitialRun ) {
111- UIApplication.sharedApplication .delegate .window .rootViewController = nil ;
112- }
113-
114- self-> _isInitialRun = NO ;
102+ UIApplication.sharedApplication .delegate .window .rootViewController = [RNNSplashScreenViewController getSplashScreenVC ];
115103
116104 [self ->_commandsHandler setReadyToReceiveCommands: true ];
117105 // TODO: Refactor
@@ -122,8 +110,5 @@ - (void)onJavaScriptLoaded {
122110 });
123111}
124112
125- - (void )onReload {
126- }
127-
128113@end
129114#endif
0 commit comments