From ef401168ecf7127a3e832bb0a28a45cd96808735 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Sat, 25 Feb 2023 16:42:45 +0100 Subject: [PATCH] Use only tab navigation on iPhone --- Shared/Constants.swift | 8 ++++++++ Shared/Navigation/ContentView.swift | 8 ++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Shared/Constants.swift b/Shared/Constants.swift index bbcecebf..f7826ef6 100644 --- a/Shared/Constants.swift +++ b/Shared/Constants.swift @@ -5,6 +5,14 @@ import SwiftUI struct Constants { static let yatteeProtocol = "yattee://" static let overlayAnimation = Animation.linear(duration: 0.2) + static var isIPhone: Bool { + #if os(iOS) + UIDevice.current.userInterfaceIdiom == .phone + #else + false + #endif + } + static var progressViewScale: Double { #if os(macOS) 0.4 diff --git a/Shared/Navigation/ContentView.swift b/Shared/Navigation/ContentView.swift index a0cd1488..60535987 100644 --- a/Shared/Navigation/ContentView.swift +++ b/Shared/Navigation/ContentView.swift @@ -25,10 +25,14 @@ struct ContentView: View { var body: some View { Group { #if os(iOS) - if horizontalSizeClass == .compact { + if Constants.isIPhone { AppTabNavigation() } else { - AppSidebarNavigation() + if horizontalSizeClass == .compact { + AppTabNavigation() + } else { + AppSidebarNavigation() + } } #elseif os(macOS) AppSidebarNavigation()