SwiftUI design options needed

OK, I'm going to try SwiftUI one more time. Every other time I've tried it I've run into major blockages that prevented it from being usable.

So far I've code up this basic design (see screenshot at end). It's a common thing: Filters in the left sidebar, filtered assets in the center list (ignore the temp IDs for debugging purposes), and a detail view of the selected asset on the right. I have no part of the filters figured out yet, so I wouldn't mind getting advice of how to use that to filter the SwiftData. It's currently just using the common @Query to get all the items into a var of the main ContentView.

As for the asset list and detail view, my current layout works, but the detail only shows for the first item clicked.

Rather than show my SwiftUI code, it might be best to just ask for expert opinions about what is the right way to achieve this design. I want it to run on macOS and iOS. The details field all need to be editable. I'm currently doing this by declaring a struct as such:

struct TitledField:View {
	let					title:String;
	@Binding var		value:String;
	
	var body:some View {
		LabeledContent("\(self.title):") {
			TextField(self.title, text:$value)
				.labelsHidden();
		}
	}
}

Answered by szymczyk in 909840022

A three column NavigationSplitView should give you the design you want. The following article provides an introduction to NavigationSplitView:

https://swiftprogramming.com/navigationsplitview-swiftui/

Accepted Answer

A three column NavigationSplitView should give you the design you want. The following article provides an introduction to NavigationSplitView:

https://swiftprogramming.com/navigationsplitview-swiftui/

I was using a NavigationSplitView, but the huge mess of different ways it can be used was throwing a wrench into the works. The linked article really helped and showed different things that actually worked. Thanks!

SwiftUI design options needed
 
 
Q