-
Notifications
You must be signed in to change notification settings - Fork 0
/
ContentView.swift
33 lines (25 loc) · 1.02 KB
/
ContentView.swift
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
import SwiftUI
import CoreGraphics
struct ContentView: View {
@State var detailSelection:Int? = 0
@State var progress = 0.0
@State var columnVisibility = NavigationSplitViewVisibility.doubleColumn
var body: some View {
NavigationSplitView(columnVisibility: $columnVisibility,sidebar: {
List(sections, id: \.id, selection: $detailSelection) { section in
Label(section.name, systemImage: section.icon)
}
.listStyle(.sidebar)
.navigationTitle("Bezier Curves")
}, detail: {
PageView(selection: $detailSelection, columnVisibility: $columnVisibility)
.onChange(of: detailSelection, perform: { _ in
if detailSelection != 0 && detailSelection != 4 {
columnVisibility = .detailOnly
}else {
columnVisibility = .doubleColumn
}
})
})
}
}