I am trying to pop a view controller VC1 from one navigation controller NC1 to another view controller VC2 in another navigation controller NC2.
I am using the VIPER architecture thus routing between different view controllers in different navigational hierarchies requires that I must switch to the root of the navigation controller I want to present.
So the issue here is that, after navigating to the view controller VC2 of the second navigation controller NC2, I want to go back to the first view controller VC1 in the first navigation controller NC1.
I have tried the following:
self.navigationController?.popViewController(animated: true)
navigationController?.dismiss(animated: true, completion: nil)
view.window?.rootViewController?.dismiss(animated: true, completion: nil)
self.navigationController?.popToRootViewController(animated: true)
but none of them worked for me. Any ideas?
AppNavigationFlow
. And that singleton class you can store your both navigationController objects. – bestiosdeveloperNC1
(that is, presented modally over a current view controller) that is currently showingVC1
and you want to tap a button to navigate toNC2
showingVC2
? – DonMag