Multiple issues with SwiftUI TabView in sidebarAdaptable mode

We are trying to write an iOS app that supports regular and constrained widths using a TabView with .tabViewStyle(.sidebarAdaptable). On the surface this seems like a great way to write an app that supports all the different widths that your app may run in. Especially since Stage Manager and Apple Vision have made it easy for users to resize your apps window while it is running.

We are facing many challenges though. I will give a brief one liner of each below, but to truly experience them you need to run the sample app, or watch the sample videos included.

Issues

Basic TabView Issues

  1. Double Navigation Bar: When tabs are collapsed into a "More" tab, there's an unwanted double navigation bar
  2. Selection Sync: Tab selection gets out of sync when switching between narrow/wide layouts through the "More" tab

TabView Crash

  • Fatal crash occurs when resizing window to narrow width while Tab 5 is selected
  • Error: SwiftUI/SidebarAdaptableTabViewStyle_iOS.swift:482: Fatal error: Tried to update with invalid selection value

Section Handling Issues

  1. Section Display Bug: Bottom tabs incorrectly show section names instead of tab names in narrow width
  2. Tab Selection Mismatch: Tab identifiers don't match selected tabs in narrow width mode

Customization Issues

  • Inconsistent "Edit" button behavior in More tab
  • Unable to properly disable tab customization

Sample app and video

https://github.com/copia-wealth-studios/swiftui-tabview-sample

@cody They’re a few known issues here, and I would suggest you file separate bug reports for each of them. Post the feedback ID number here once you do.

You wrote:

Double Navigation Bar: When tabs are collapsed into a "More" tab, there's an unwanted double navigation bar

This is known issue. Please file a bug report, include a small Xcode project and some directions that can be used to reproduce the problem, and post the FB number here once you do. Bug Reporting: How and Why? has tips on creating your bug report.

Selection Sync: Tab selection gets out of sync when switching between narrow/wide layouts through the "More" tab

File a bug report for this. As you workaround, you would need to keep track of the selection state for Views in the more tab using OnAppear

For:

Fatal crash occurs when resizing window to narrow width while Tab 5 is selected Error: SwiftUI/SidebarAdaptableTabViewStyle_iOS.swift:482: Fatal error: Tried to update with invalid selection value

And:

Inconsistent "Edit" button behavior in More tab Unable to properly disable tab customization

Please file a bug report for this issue.

Continuing testing on beta builds and please test on the latest beta build (iOS & iPadOS 18.4 Beta ) to verify if you're still able to reproduce the issue.

Multiple issues with SwiftUI TabView in sidebarAdaptable mode
 
 
Q