-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[iOS] Crash upon resuming the app - fix #23360
Conversation
741bb9c
to
7533fd5
Compare
|
||
if (OperatingSystem.IsIOSVersionAtLeast(15)) | ||
{ | ||
foreach(var windowScene in application.ConnectedScenes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we can just reduce all this code down to just this foreach statement for APIs > 13+
public static IWindow? GetWindow(this UIApplication application)
{
// If there's only one window to return then just return that window
var windows = IPlatformApplication.Current?.Application?.Windows ?? Array.Empty<IWindow>();
if (windows.Count == 1)
return windows[0];
if (OperatingSystem.IsIOSVersionAtLeast(13))
{
foreach(var windowScene in application.ConnectedScenes)
{
if (windowScene is UIWindowScene uiWindowScene)
{
if(uiWindowScene.Windows.Length == 1 && uiWindowScene.Windows[0].GetWindow() is IWindow window)
{
return window;
}
}
}
}
else
{
if(application.Windows.Length == 1)
return application.Windows[0].GetWindow();
}
return application.GetKeyWindow().GetWindow();
}
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
this.AddLogicalChild(page); | ||
var handler = page.ToHandler(this.Handler.MauiContext); | ||
|
||
uIWindow.RootViewController = new UIViewController(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll need to if/def this code for iOS
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
/rebase |
94c9a84
to
56bba0b
Compare
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
|
||
[Test] | ||
[Category(UITestCategories.Window)] | ||
public void OpenAlertWithModals() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is failing on catalyst. Is this test and scenario relevant on catalyst?
/rebase |
56bba0b
to
aeeaf54
Compare
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/rebase |
aeeaf54
to
a6e621d
Compare
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
Failing tests unrelated |
Issues Fixed
Fixes #21948
Screen.Recording.2024-06-29.at.13.15.13.mov
Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-06-29.at.13.11.30.mp4