Post

Replies

Boosts

Views

Activity

Reply to NavigationSplitView
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:
Jan ’23
Reply to NavigationSplitView
For column one I setup an enum enum Nav: String, Hashable, CaseIterable and the cases are the different Entity names. And then use a list to display them. For column two I'd need a way to show the ListView() for whatever Entity name was selected from column one. And then the third column you show the DetailView() of the selected ListView() item. I guess is my sudo way of thinking about how it should work. But maybe that's not a great way of how you'd go about it?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’23
Reply to File System vs Core Data for persisting data
Thanks for the reply! Absolutely right, I didn't tell much about what kind of data I plan on storing. My app does use relationships, but at the same time, the data types are only strings and decimals with one boolean. I have four entities total: Bins has many Tickets Drivers has many Tickets Fields has many Tickets Ticket belongs to a Bin, belongs to a Field, and Belongs to a Driver Could I be just fine persisting to the File System, or would something like this be better off using Core Data? I currently have it set up using core data, I'm just getting hung up when I'm creating my form for a Ticket. I go to use a picker to select what Field, picker for Driver, picker for Bin, but those are grayed out when I run the app. And I am struggling to find resources to help with that issue. I am using SwiftUI for this.
Mar ’22