Add a Navigation setting to keep the tab bar on large screens

iPad and iPhone Duo users can pick Tab Bar instead of Automatic to opt
out of the sidebar layout. Switching rebuilds the navigation Settings
lives in, so the change asks for confirmation and lands on Home first.
This commit is contained in:
Arkadiusz Fal
2026-10-11 21:28:51 +02:00
parent 2c662b34e3
commit 6e8835237d
8 changed files with 199 additions and 9 deletions

View File

@@ -170,12 +170,13 @@ enum NavigationLayout {
/// iPhone Duo inner screen in either orientation). A large iPhone in
/// landscape is regular width but compact height, so it keeps the tab
/// bar. An iPad keeps the sidebar for as long as its width is regular,
/// even in a short Stage Manager window.
/// even in a short Stage Manager window. The `.tabBar` style opts out.
static func usesSidebar(
horizontalSizeClass: UserInterfaceSizeClass?,
verticalSizeClass: UserInterfaceSizeClass?
verticalSizeClass: UserInterfaceSizeClass?,
style: NavigationStyle = .automatic
) -> Bool {
guard horizontalSizeClass == .regular else { return false }
guard style == .automatic, horizontalSizeClass == .regular else { return false }
return verticalSizeClass == .regular || UIDevice.current.userInterfaceIdiom == .pad
}
}