From 8ce27df08ad85ae3582f7734ff0164871ce465e6 Mon Sep 17 00:00:00 2001 From: Tommy Nguyen Date: Thu, 20 Feb 2020 15:36:03 -0800 Subject: [PATCH] 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 | |:------:|:------:| | image | image | Reviewed By: cpojer Differential Revision: D20008608 Pulled By: hramos fbshipit-source-id: ce59fd0b000d7dee51985a5533d9b5791687f592 --- React/DevSupport/RCTDevLoadingView.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/React/DevSupport/RCTDevLoadingView.m b/React/DevSupport/RCTDevLoadingView.m index f2dbd6b389779d..5fd10fc36d07ee 100644 --- a/React/DevSupport/RCTDevLoadingView.m +++ b/React/DevSupport/RCTDevLoadingView.m @@ -94,6 +94,11 @@ - (void)setBridge:(RCTBridge *)bridge 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; + } }); }