I’m building a Files-style SwiftUI app and my primary goal is to adopt both:
NavigationSplitViewon wider (regular) widths (iPad/macOS), andTabView+NavigationStackon narrow (compact) widths (iPhone),
—so that the app feels native on any device.
Beyond simply swapping containers, I need two key behaviors:
Completely remove the tab bar when in regular width (so no tab bar floating above the app).
Preserve the full navigation hierarchy across size-class changes — for example, if the user drills into Browse → Documents → MyFolder → FileInfo on iPad, then rotates or switches to iPhone width, the compact stack should land directly in FileInfo with its back-button chain intact, and vice versa.
This kind of visual structure is present in 'Files', 'Shortcuts', 'Health' app. Any insights? Thanks!
I tried to wrap NavigationSplitView() within TabView() but I was unable to hide the TabView on .regular horizontalClassSize (i.e. wider width view).


TabViewwith.sidebarAdaptablestyle? There is noNavigationSplitView..inspectorfor the detail? That’s a pane in regular and sheet in compact.