From 74b667dbc2a48183dec0b9c3b5401bc3f9e54e7b Mon Sep 17 00:00:00 2001 From: Tommy Nguyen Date: Wed, 26 Feb 2020 19:03:10 -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: PeteTheHeat Differential Revision: D20104655 Pulled By: hramos fbshipit-source-id: 86c1902c00f791fd23f75ea7562b44c92e719c5e --- React/DevSupport/RCTDevLoadingView.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/React/DevSupport/RCTDevLoadingView.m b/React/DevSupport/RCTDevLoadingView.m index f2dbd6b389779d..fbc8add18f766c 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, *)) { + id scene = [[RCTSharedApplication() valueForKey:@"connectedScenes"] anyObject]; + [self->_window setValue:scene forKey:@"windowScene"]; + } }); }