0

I'd like to know the best way to handle view controllers when there are multiple ways for the user to navigate through an app. The problem is that the user might (for example) trigger a segue by selecting a table row, Then, from the presented view controller they might click a button in a custom toolbar to go somewhere else.

I'm pretty new at this, so while I understand using a segue to present a view controller, and then having to dismiss the presented view controller at some point, I'm less clear on how to manage things when a user has free reign to go wherever they want! I'm using container views to embed a header and a custom toolbar at the bottom of each view. Should I be using a container for each view controller as well?

squarehippo10
  • 1,855
  • 1
  • 15
  • 45
  • This [link](https://stackoverflow.com/questions/47273506/navigation-controller-loop/47278412#47278412) may help. You can achieve any transition w/ animation easily. – beshio Aug 02 '18 at 03:40

1 Answers1

0

If you are quite down the stack and you don‘t want to offer a back button for simplicity, then you go up the stack by calling dismiss and tell the delegate where you want to go until you reach the appropriate level which can move you up until you are where you wanted to go.

The alternative is to move up the delegate chain until you can move down again and from there call dismiss and then go down where you want to go.

Fabian
  • 5,040
  • 2
  • 23
  • 35