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: PeteTheHeat

Differential Revision: D20104655

Pulled By: hramos

fbshipit-source-id: 86c1902c00f791fd23f75ea7562b44c92e719c5e
  • Loading branch information
tido64 authored and facebook-github-bot committed Feb 27, 2020
1 parent 7d2daa0 commit 74b667d
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, *)) {
id scene = [[RCTSharedApplication() valueForKey:@"connectedScenes"] anyObject];
[self->_window setValue:scene forKey:@"windowScene"];
}
});
}

Expand Down

0 comments on commit 74b667d

Please sign in to comment.