alright I think I have what I want. Curious if this is a good practice or not though, because I am just starting out at this stuff.
enum Nav: String, Hashable, CaseIterable {
case view1 = "View 1"
case view2 = "View 2"
case view3 = "View 3"
}
struct Three ColumnContentView: View {
@State private var selectedNav: Nav?
var body: some View {
NavigationSplitView {
List(Nav.allCases, id: \.self, selection: $selectedNav) { nav in
NavigationLink(nav.rawValue, value: nav)
}
} content: {
switch selectedNav {
case .view1:
ViewOneView()
case .view2:
ViewTwoView()
default:
Text("Select a nav item")
}
} detail: {
Text("select a list item")
}
}
now I just need to figure out how to get the detail view to show up correctly
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: