I have 3 views: A (the main one), B and C. From ViewA one can navigate to either ViewB or ViewC, while B and C can only dismiss themselves, like in the "diagram" below:
A
/ \
B C
Depending on what happens in ViewB, I want to go back in ViewA and open ViewC. I tried sending the state var in ViewB as a binding.
NavigationLink(destination: B_View(locations: self.$showC), isActive: $showB) { EmptyView() }
This way, when I need to, I can toggle showC
from within ViewB, with the following result:
- View B is dismissed
- View C is pushed and displayed
- View C is dismissed, too :(
What should I do in order to keep ViewC from being dismissed automatically?