maui icon indicating copy to clipboard operation
maui copied to clipboard

Update PageViewController with events we can hook into for lifecycle methods like ViewDidAppear

Open JohnHDev opened this issue 3 years ago • 2 comments

Description

The new handler style doesn't hook in well in PageHandler for UIViewController lifecycle events. In XF we override ViewWillAppear but we can't do that with handlers (as far as I can see).

Since PageHandler uses a PageViewController MS can update that with lifecycle events so we can wire up cleanly.

https://github.com/dotnet/maui/blob/bd64a7ab2f1c0992d667d93576d16bc565d0e041/src/Core/src/Platform/iOS/PageViewController.cs

Public API Changes

Add ViewWillAppear and other lifecycle events to PageViewController.

Intended Use-Case

Much easier customisation on iOS, think adding buttons on the left instead of the right. Can't do this easily with the current Handler implementation.

JohnHDev avatar Sep 14 '22 18:09 JohnHDev

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.

ghost avatar Sep 15 '22 18:09 ghost

@JohnHDev Yea :-/ we really need to provide a virtual method for the ViewController

Not a great solution but can you just copy and paste that whole https://github.com/dotnet/maui/blob/main/src/Core/src/Handlers/Page/PageHandler.iOS.cs#L10-L25 into your handler?

PureWeen avatar Sep 19 '22 22:09 PureWeen

@PureWeen Thanks, yes that should work, I'll take another look at this shortly.

JohnHDev avatar Oct 05 '22 13:10 JohnHDev