Skip to content
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

Fix timing on iOS Toolbar #12888

Merged
merged 3 commits into from
Jan 26, 2023
Merged

Fix timing on iOS Toolbar #12888

merged 3 commits into from
Jan 26, 2023

Conversation

PureWeen
Copy link
Member

@PureWeen PureWeen commented Jan 24, 2023

Description of Change

With MAUI we moved the code for processing Toolbar logic up into the xplat layer by way of an xplat Toolbar control. This allowed us to consolidate the toolbar logic that was copy and pasted across all platforms and between shell and non-shell. On iOS the shell toolbar management is handled by ShellPageToolbarTracker which gets instantiated for every single page. The code inside that tracker needs to ignore any toolbar updates if it's not the currently visible page.

iOS is also a little bit tricky to wire up with regards to timing the back button title text. The BackButton text is based on the UIViewController.NavigationItem of the previous page so we have to pull the BackButtonBehavior off the incoming page and set it on the NavItem of the previous page before the current page is visible. NavigationPage gets around this by making it so the user has to set NavigationPage.BackButtonTitle on the previous page. NavigationPage basically replicates how iOS propagates back button text where as Shell lets you set the back button text on the currently visible page.

Issues Fixed

Fixes #10945
Fixes #11691
Fixes #9269
Fixes #9842
Fixes #9687
Fixes #8335
Fixed #10452

@PureWeen PureWeen force-pushed the fix_ios_toolbar_quirks_take_2 branch from e18e3ac to 2e7ff60 Compare January 24, 2023 16:52
@PureWeen PureWeen marked this pull request as ready for review January 24, 2023 17:13
@PureWeen
Copy link
Member Author

@rmarinho I tested this on a 13.7 and a 14.5 iPhone

Let me know if I should test back further from that.

@PureWeen PureWeen enabled auto-merge (squash) January 24, 2023 21:07
//Pre iOS 15
item = item ?? uINavigationBar.FindDescendantView<UIView>(result =>
{
return result.Class.Name?.Contains("UINavigationBarContentView", StringComparison.OrdinalIgnoreCase) == true;
Copy link
Member Author

@PureWeen PureWeen Jan 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rmarinho here's the update that fixes for iOS13/14

Copy link
Member

@rmarinho rmarinho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reverts commit 5abffde.

# Conflicts:
#	src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt
#	src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
@PureWeen PureWeen force-pushed the fix_ios_toolbar_quirks_take_2 branch from e27ee5a to 4eb2219 Compare January 26, 2023 17:27
@PureWeen PureWeen merged commit bb0ad48 into main Jan 26, 2023
@PureWeen PureWeen deleted the fix_ios_toolbar_quirks_take_2 branch January 26, 2023 23:05
@hartez hartez added backport/suggested The PR author or issue review has suggested that the change should be backported. backport/NO This change should not be backported. It may break customers. labels Feb 15, 2023
@PureWeen PureWeen removed the backport/NO This change should not be backported. It may break customers. label Apr 13, 2023
@PureWeen
Copy link
Member Author

Adding this one back into the pool for some discussion. This one fixes a bunch of issues and I think we can break apart a few parts of this one.

For example, I think just backporting the xplat changes here will fix a number of issues

@angelru
Copy link

angelru commented Apr 19, 2023

When will these changes be available?

@hartez hartez added the backport/NO This change should not be backported. It may break customers. label May 24, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 14, 2023
@samhouts samhouts added the fixed-in-8.0.0-preview.1.7762 Look for this fix in 8.0.0-preview.1.7762! label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-toolbar ToolBar backport/NO This change should not be backported. It may break customers. backport/suggested The PR author or issue review has suggested that the change should be backported. fixed-in-8.0.0-preview.1.7762 Look for this fix in 8.0.0-preview.1.7762! platform/iOS 🍎
Projects
None yet
6 participants