I have a very simple NavigationSplitView
setup.
The first time you press the NavigationLink
it pushes the next view, but then immediately dismisses it. Tap it again and it correctly pushes and stays on screen.
Then when tapping the second NavigationLink
it pushes a view but just shows a yellow warning triangle and not the text.
Then when pressing the back button, it shows the initial view first, then the second view 🤷♂️
This is on iOS 16 beta 4.
Any idea what is going on here?
struct ContentView: View {
@State var splitViewVisibility: NavigationSplitViewVisibility = .all
var body: some View {
NavigationSplitView(columnVisibility: $splitViewVisibility) {
List {
NavigationLink("First", destination: DetailView(string: "First"))
}
} detail: {
Text("Select the first view from the list")
}
.navigationSplitViewStyle(.balanced)
}
}
struct DetailView: View {
var string: String
var body: some View {
NavigationStack() {
List {
NavigationLink("Second", value: "Second")
}
.navigationDestination(for: String.self, destination: { string in
Text(string)
})
}
.navigationTitle(string)
}
}