Showing 1 changed files with 25 additions and 0 deletions
+25 -0
USB Meter/Views/ContentView.swift
@@ -11,10 +11,35 @@
11 11
 import SwiftUI
12 12
 
13 13
 struct ContentView: View {
14
+    #if os(iOS)
15
+    private static let isPhone: Bool = UIDevice.current.userInterfaceIdiom == .phone
16
+    #else
17
+    private static let isPhone: Bool = false
18
+    #endif
19
+
14 20
     var body: some View {
21
+        if Self.isPhone {
22
+            navigationViewPhone
23
+        } else {
24
+            navigationViewPad
25
+        }
26
+    }
27
+
28
+    @ViewBuilder
29
+    private var navigationViewPhone: some View {
30
+        NavigationView {
31
+            SidebarView()
32
+                .navigationBarTitle(Text("USB Meters"), displayMode: .inline)
33
+        }
34
+        .navigationViewStyle(.stack)
35
+    }
36
+
37
+    @ViewBuilder
38
+    private var navigationViewPad: some View {
15 39
         NavigationView {
16 40
             SidebarView()
17 41
                 .navigationBarTitle(Text("USB Meters"), displayMode: .inline)
18 42
         }
43
+        .navigationViewStyle(.columns)
19 44
     }
20 45
 }