I have code as below.
import SwiftUI
struct ContentView: View {
var body: some View {
TabView {
NavigationStack {
NavigationLink("Tap Me") {
Text("Detail View")
.toolbar(.hidden, for: .tabBar)
}
.navigationTitle("Primary View")
}
.tabItem {
Label("Home", systemImage: "house")
}
}
}
}
#Preview {
ContentView()
}
When I click Tap Me it takes me to details & when click back it take back from details, which is fine.
If I try this multiple times, navigation is happening only 2 times which is weird.
Any idea why this is happening?

Use
NavigationLinkwithvalue, which is used byNavigationDestinationto present the next view.