Skip to content

Commit 9b1d189

Browse files
Sort ConnectedScenes according to UIWindowScene
1 parent a761e83 commit 9b1d189

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

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

0 commit comments

Comments
 (0)