Post

Replies

Boosts

Views

Activity

Reply to NavigationSplitView issues in iOS 18 and 18.1
I have the same issue. As soon as I have a NavigationStack that wraps around a NavigationSplitView, the NavigationStacks within it don't function correctly. However, if I return to the Home screen and go back to the app, the navigation works as expected. This behavior works fine on iOS 17.. Here is the code that allows you to reproduce the problem: extension MainView { struct NavigationDestination { struct SecondView: Hashable { } } } struct MainView: View { @State private var navigationPath: NavigationPath = NavigationPath() var body: some View { NavigationStack(path: $navigationPath) { VStack { Button { navigationPath.append(MainView.NavigationDestination.SecondView()) } label: { Text("First Navigation") } } .navigationDestination(for: MainView.NavigationDestination.SecondView.self) { _ in SecondView() .navigationTitle("DetailView") } } } } extension SecondView { struct NavigationDestination { struct Detail: Hashable { } } } struct SecondView: View { var body: some View { NavigationSplitView { List { Text("test") } } detail: { NavigationStack { VStack { NavigationLink(value: SecondView.NavigationDestination.Detail()) { Text("test") } } .navigationDestination(for: SecondView.NavigationDestination.Detail.self) { subItem in Text("Detail") } } } } }
1w