Skip to content

Commit ccae525

Browse files
UseTabView for tvOS in ContentView
1 parent 859abfc commit ccae525

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

dcbattwebhook-swift/ContentView.swift

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,26 @@ struct ContentView: View {
1919

2020
var body: some View {
2121
VStack {
22+
#if os(tvOS)
23+
TabView {
24+
HomeUIView()
25+
.tabItem {
26+
Label("Home", systemImage: "house")
27+
}
28+
SettingsView()
29+
.tabItem {
30+
Label("Settings", systemImage: "gearshape")
31+
}
32+
HelpView()
33+
.tabItem {
34+
Label("Help", systemImage: "questionmark.circle")
35+
}
36+
AboutView()
37+
.tabItem {
38+
Label("About", systemImage: "person.circle")
39+
}
40+
}
41+
#else
2242
NavigationView {
2343
List() {
2444
NavigationLink(destination: HomeUIView(), isActive: $isShowingHome, label: {
@@ -48,6 +68,7 @@ struct ContentView: View {
4868
.padding()
4969
#endif
5070
}
71+
#endif
5172
}.onAppear() {
5273
if defaults.bool(forKey: "IsFirstLaunch") == false {
5374
DoAppFirstTimeLaunch()

0 commit comments

Comments
 (0)