Skip to content

Commit

Permalink
iOS: Fix RCTDevLoadingView not showing up with UIScene (#27916)
Browse files Browse the repository at this point in the history
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: #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
  • Loading branch information
tido64 authored and facebook-github-bot committed Feb 20, 2020
1 parent 7f2a79f commit 8ce27df
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions React/DevSupport/RCTDevLoadingView.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
});
}

Expand Down

0 comments on commit 8ce27df

Please sign in to comment.