SwiftUI navigationDestination called twice

  • Xcode 16.0 beta 4 (16A5211f)
  • iOS 18.0 beta 4

In SwiftUI, I have a TabView and a NavigationStack that contains a List in one of the tabs. In iOS 18 beta 4 simulator the following happens: when I first click on a different tab in the TabView and the back to the original tab and then click on a list item, navigationDestination is triggered twice. In the simulator, the destination detail view is pushed twice on the stack.

This does not happen when running the same app with the same Xcode version but in iOS 17.0 simulator.

It this a known bug or could it be some problem in my code?

Unfortunately it's a bit difficult to exctract a simple example demonstrating the issue as this is a complex project.

Answered by DTS Engineer in 798462022

@l00 There's alot of context missing here that a test project would help provide. Without a test project it's difficult to investigate the issue and it would help us better understand what's going on.

If you're not familiar with preparing a test project, take a look at Creating a test project

@l00 There's alot of context missing here that a test project would help provide. Without a test project it's difficult to investigate the issue and it would help us better understand what's going on.

If you're not familiar with preparing a test project, take a look at Creating a test project

SwiftUI navigationDestination called twice
 
 
Q