iOS: Fix RCTDevLoadingView not showing up with UIScene (#27916)

Summary:
Attaches the loading view to a `UIScene` in apps using the new Scenes API (iOS 13+).

## Changelog

[iOS] [Fixed] - Fix RCTDevLoadingView not showing up with UIScene
Pull Request resolved: https://github.com/facebook/react-native/pull/27916

Test Plan:
Create a new app based on UIScene and integrate React Native.

| Before | After  |
|:------:|:------:|
 | <img width="453" alt="image" src="https://user-images.githubusercontent.com/4123478/73485717-eccfe800-43a3-11ea-96fd-f7077a348345.png"> | <img width="453" alt="image" src="https://user-images.githubusercontent.com/4123478/73485749-f9ecd700-43a3-11ea-8a18-2e2185e62e78.png"> |

Reviewed By: cpojer

Differential Revision: D20008608

Pulled By: hramos

fbshipit-source-id: ce59fd0b000d7dee51985a5533d9b5791687f592
This commit is contained in:
Tommy Nguyen
2020-02-20 15:38:16 -08:00
committed by Facebook Github Bot
parent 7f2a79f40b
commit 8ce27df08a
+5
View File
@@ -94,6 +94,11 @@ RCT_EXPORT_METHOD(showMessage:(NSString *)message color:(UIColor *)color backgro
self->_label.textColor = color;
self->_window.backgroundColor = backgroundColor;
self->_window.hidden = NO;
if (@available(iOS 13.0, *)) {
UIWindowScene *scene = (UIWindowScene *)RCTSharedApplication().connectedScenes.anyObject;
self->_window.windowScene = scene;
}
});
}