dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.17k stars 1.74k forks source link

Fix iOS to key loaded/unloaded off a more correct platform event #13277

Open PureWeen opened 1 year ago

PureWeen commented 1 year ago

Description

Ideally, we would key loaded/unloaded off of didMovetoWindow on UIView but there's no way (AFAIK) to reach this with overriding every single view.

The current implementation is fiddly and probably not reliable in all scenarios. Basically, it adds observables to various layers of the view and waits until one of those triggers to fire loaded.

https://github.com/dotnet/maui/blob/main/src/Core/src/Platform/iOS/ViewExtensions.cs#L659

Steps to Reproduce

Some thoughts

Link to public reproduction project repository

N/A

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS, macOS

Affected platform versions

ios/catalyst

Did you find any workaround?

No response

Relevant log output

No response

ghost commented 1 year ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

MichaelSL commented 1 year ago

I wonder if this relates to the different behavior of Loaded event on Android and iOs. I have Shell application with several pages.

On Android:

  1. application starts up with Page1
  2. Page1 Loaded event handler fires
  3. navigate to Page2
  4. return to Page1
  5. Page1 Loaded event doesn't fire

On iOS:

  1. application starts up with Page1
  2. Page1 Loaded event handler fires
  3. navigate to Page2
  4. return to Page1
  5. Page1 Loaded event always fire

Basically, cross platform code needs workaround for iOs to avoid running same code multiple times. I wonder if this issue will help to make lifecycle events behavior more uniform?

jstedfast commented 1 year ago

This honestly doesn't feel like a "Good First Issue". It seems far too complicated for someone new to the team to even attempt.