I need to display a "Search and add item to list" workflow in a SwiftUI Mac App that requires comparing lots of details. Therefore I want to show a NavigationSplitView with search results and detail view in a sheet (to make the workflow modal).
However the NavigationSplitView is missing its children's navigation bars and bar items.
Here is a really simple sample app demonstrating the problem. It should display a navigationTitle but doesn't:
struct ContentView: View {
var body: some View {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundStyle(.tint)
Text("Hello, world!")
}
.padding()
.frame(width:800, height:800)
.sheet(isPresented: .constant(true), content: {
NavigationSplitView {
List {
Text("Item")
}
.navigationTitle("Title")
} detail: {
Text("Detail")
}
.frame(width:600, height:400)
})
}
}
How to fix/work around this?