Skip to content

1.4.7

Latest

Choose a tag to compare

@97chos 97chos released this 17 Nov 01:15

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 writes tabBar.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 inside setViewControllers. The same updateUIViewController call then sets it back to false.
  • 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 isHiddenDefaultTabbar parameter and property from TabLinkNavigationView.
  • Removed the tabBar.isHidden assignment from updateUIViewController.
  • Updated the TabNavigator examples.

Migration

  • Remove the isHiddenDefaultTabbar: argument from TabLinkNavigationView(...).
  • To hide the default tab bar on a screen, set hidesBottomBarWhenPushed = true on 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

  • hidesBottomBarWhenPushed is 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 = true hides the tab bar even as the navigation root. A control run with false shows 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 = true was meant for.

Known Limitation

  • On iPadOS 18 and later, the floating tab bar ignores both hidesBottomBarWhenPushed and tabBar.isHidden. This release does not change that behavior.