Skip to content

Commit 56b1d0c

Browse files
committed
Fixed condition for selecting connected scene
1 parent 9b1d189 commit 56b1d0c

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Rg.Plugins.Popup/Platforms/Ios/Impl/PopupPlatformIos.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,9 @@ public Task AddAsync(PopupPage page)
5858
PopupWindow window;
5959
if (IsiOS13OrNewer)
6060
{
61-
var connectedScene = UIApplication.SharedApplication.ConnectedScenes.ToArray()
62-
.OrderBy(x => x is UIWindowScene)
63-
.FirstOrDefault(x => x.ActivationState == UISceneActivationState.ForegroundActive);
64-
if (connectedScene != null && connectedScene is UIWindowScene windowScene)
65-
window = new PopupWindow(windowScene);
61+
if (UIApplication.SharedApplication.ConnectedScenes.ToArray()
62+
.FirstOrDefault(x => x.ActivationState == UISceneActivationState.ForegroundActive && x is UIWindowScene) is UIWindowScene connectedScene)
63+
window = new PopupWindow(connectedScene);
6664
else
6765
window = new PopupWindow();
6866

0 commit comments

Comments
 (0)