Skip to content

fix(ios): match tab bar items to tabs by identity - #602

Merged
thiagobrez merged 1 commit into
mainfrom
fix/ios27-tab-item-order
Oct 21, 2026
Merged

thiagobrez merged 1 commit into
mainfrom
fix/ios27-tab-item-order

Conversation

@thiagobrez

Copy link
Copy Markdown
Collaborator

PR Description

Bug fix. Fixes #596.

When an app is built with the iOS 27 SDK, UITabBar.items follows display order, so a search role tab moves to the end. UITabBarController.tabs keeps declaration order. configureTabBarItemImages matched items to filteredItems by position, so every tab after the search tab got the next route's title, selected icon and accessibility label. Presses still reached the right route, which made the tab labelled Library open Search.

This matches each item to its tab by identity (tabs[i].viewController?.tabBarItem === item) on iOS 18+, and falls back to the position otherwise. Builds with the iOS 26 SDK keep the old order, so they behave as before.

#588 changes the same function, so whichever lands second needs a small rebase.

How to test?

  1. Build the reproducible code from iOS 27 SDK: tab titles and icons land on the wrong tabs when one tab has role "search" #596 with Xcode 27. React Native 0.87 apps crash at launch with the iOS 27 SDK because they don't use the scene lifecycle; the 0.88 template does.
  2. Before: the bar reads Home, Search, Favorites, Library, the search tab's selected icon is the Library icon, and Search opens Favorites, Favorites opens Library, Library opens Search.
  3. After: the bar reads Home, Favorites, Library, Search, and each tab opens its own screen.

Verified in a fresh React Native 0.88.0 app with agent-device, reading the tab labels and pressing every tab:

Built with Simulator Before After
Xcode 27.1 iOS 27.0 ❌ ✅
Xcode 27.1 iOS 26.5 not run ✅
Xcode 27.1 iOS 18.6 not run ✅
Xcode 26.6 iOS 27.0 ✅ ✅

Not tested: physical devices, iPad sidebar, tvOS, visionOS, hidden tabs and the More tab.

Screenshots

Xcode 27.1, iOS 27.0, after pressing the last tab:

Before: the tab labelled Library opens Search After
Before After

🤖 Generated with Claude Code

When built with the iOS 27 SDK, UITabBar.items follows display order and a
search role tab moves to the end, while UITabBarController.tabs keeps
declaration order. Matching items to routes by position shifted titles,
selected images and accessibility labels for every tab after the search tab.

Fixes #596

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iOS 27 SDK: tab titles and icons land on the wrong tabs when one tab has role "search"

1 participant