Repository navigation
Summary
This release fixes a bug where the UIKit tab bar stayed visible on pages pushed with hidesBottomBarWhenPushed = true. It removes isHiddenDefaultTabbar from TabLinkNavigationView. Tab bar visibility is now decided only by each page's hidesBottomBarWhenPushed.
Issue
- On iOS 27, the tab bar stays visible on pages that set
hidesBottomBarWhenPushed = true, in two cases:- Push from a tab root. UIKit hides the tab bar at the start of the push transition. A layout pass during the transition calls
updateUIViewController, which writestabBar.isHidden = isHiddenDefaultTabbar(false) and shows the bar again. - Launch with a lower page on top, e.g.
pathList: [root, child]. UIKit hides the tab bar insidesetViewControllers. The sameupdateUIViewControllercall then sets it back tofalse.
- Push from a tab root. UIKit hides the tab bar at the start of the push transition. A layout pass during the transition calls
- Earlier iOS versions have the same conflict. The tab bar stays hidden right after a push, but reappears when the parent body is re-evaluated while a lower page is on top.
- Cause: the library and UIKit both write
tabBar.isHidden, so whichever writes last wins.
Changes
- Removed the
isHiddenDefaultTabbarparameter and property fromTabLinkNavigationView. - Removed the
tabBar.isHiddenassignment fromupdateUIViewController. - Updated the TabNavigator examples.
Migration
- Remove the
isHiddenDefaultTabbar:argument fromTabLinkNavigationView(...). - To hide the default tab bar on a screen, set
hidesBottomBarWhenPushed = trueon that view controller. This works even when it is the root of its navigation stack, e.g. a single-tab splash or login flow. - To never show the default tab bar (for example with a custom tab bar), set it on every view controller, tab roots included.
Rationale
hidesBottomBarWhenPushedis UIKit's own per-page mechanism. With a single owner of tab bar visibility, transition timing and SwiftUI update timing cannot cause a conflict.- Verified on iPhone simulators running iOS 17.2, 18.2 and 27.0:
- push and pop, including two levels deep;
- interactive swipe back, both completed and cancelled;
- launching with a lower page on top;
- the single-tab state;
- switching between one tab and four tabs;
- re-rendering while a lower page is on top.
- A page with
hidesBottomBarWhenPushed = truehides the tab bar even as the navigation root. A control run withfalseshows the bar, so the root's own value decides. - With the flag set on every page, tab roots included, the tab bar stays hidden through push, pop and tab switching. This covers the case
isHiddenDefaultTabbar = truewas meant for.
Known Limitation
- On iPadOS 18 and later, the floating tab bar ignores both
hidesBottomBarWhenPushedandtabBar.isHidden. This release does not change that behavior.