forked from skiptools/skipapp-showcase-fuse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContentView.swift
More file actions
38 lines (35 loc) · 1.21 KB
/
Copy pathContentView.swift
File metadata and controls
38 lines (35 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright 2023–2026 Skip
import SwiftUI
enum ContentTab: String, Hashable {
case about, showcase, settings
}
struct ContentView: View {
@AppStorage("tab") var tab = ContentTab.about
@AppStorage("appearance") var appearance = ""
@AppStorage("statusBarHidden") var statusBarHidden = false
var body: some View {
TabView(selection: $tab) {
AboutView()
.tag(ContentTab.about)
.tabItem {
Label("About", systemImage: "info.circle")
}
PlaygroundNavigationView()
.tag(ContentTab.showcase)
.tabItem {
Label {
Text("Showcase")
} icon: {
Image("widgets", bundle: .module, label: Text("Showcase Icon"))
}
}
SettingsView(appearance: $appearance)
.tag(ContentTab.settings)
.tabItem {
Label("Settings", systemImage: "gearshape.fill")
}
}
.preferredColorScheme(appearance == "dark" ? .dark : appearance == "light" ? .light : nil)
.statusBarHidden(statusBarHidden)
}
}