I'm working on a SwiftUI app whose navigation hierarchy over multiple views looks something like this:
[List of Places] -> [Detail of one place] -> [Map]
On the map, not only the previously selected place is shown, but also all places that are known in the [List of Places]. The user should be able to select another place on the map and display its details. It would be possible to open another instance of [Detail of one place] from the map but this way the stack of views would become longer and longer. I think it is better to go back the complete navigation hierarchy and open another [Detail of one place] from [List of Places].
Navigate back: [Map] -> [Detail of one place] - > [List of Places] -> [Detail of one place]
However, I am not sure how to implement such an approach most skilfully. I could use
self.presentationMode.wrappedValue.dismiss()
and close each view one by one and go back in the navigation. From the [List of Places] I would then automatically switch to another detail view. So far I have not tried this yet but I think if I do it I will get an animation for each closed view. I don't want you to. Switching from the map to the details should work like normal navigation.