I have a tab based app. And I wonder if its possible to unwind the user from anywhere to the root of the current tab.
My app is built like this: TabController -> (tabs) -> navigationController -> vc etc..
So lets say that I press on tab 4 in my app. Now I dig through two viewcontrollers and end up in a modal presented VC. Now I want to go back straight to the root of the tab:
tab 4 -> navigationController -> rootVC -> pushVC -> pushVC -> modalVc
So I eg from modalVc to rootVC
I know that I can do something like this, BUT I want to go to the rootVC from any VC within tab4, and using that technique would force me to create a unwind segue on all of my child VCs in tab 4
I am using notifications and when a user press on the notification I want to take the user to the rootVC from anywhere.
And using something like:
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let destinationViewController = storyboard.instantiateViewController(withIdentifier: "accountVc") as? AccountViewController
navInTab.pushViewController(destinationViewController!, animated: false)
Does not work for eg: vc -> vc -> modalVc
since it will mess up the navigationstack