[iOS] Crash upon resuming the app - fix#23360
Merged
Merged
Conversation
741bb9c to
7533fd5
Compare
PureWeen
reviewed
Jul 1, 2024
|
|
||
| if (OperatingSystem.IsIOSVersionAtLeast(15)) | ||
| { | ||
| foreach(var windowScene in application.ConnectedScenes) |
Member
There was a problem hiding this comment.
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();
}
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
kubaflo
added a commit
to kubaflo/maui
that referenced
this pull request
Jul 3, 2024
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
PureWeen
reviewed
Jul 3, 2024
| this.AddLogicalChild(page); | ||
| var handler = page.ToHandler(this.Handler.MauiContext); | ||
|
|
||
| uIWindow.RootViewController = new UIViewController(); |
Member
There was a problem hiding this comment.
We'll need to if/def this code for iOS
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Member
|
/azp run |
Member
|
/rebase |
94c9a84 to
56bba0b
Compare
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
PureWeen
approved these changes
Jul 4, 2024
PureWeen
requested changes
Jul 5, 2024
|
|
||
| [Test] | ||
| [Category(UITestCategories.Window)] | ||
| public void OpenAlertWithModals() |
Member
There was a problem hiding this comment.
This is failing on catalyst. Is this test and scenario relevant on catalyst?
Member
|
/rebase |
56bba0b to
aeeaf54
Compare
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Member
|
/rebase |
aeeaf54 to
a6e621d
Compare
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
PureWeen
approved these changes
Jul 5, 2024
PureWeen
approved these changes
Jul 5, 2024
Member
|
Failing tests unrelated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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