Reputation: 71
Say I have 3 view controllers: VC1, VC2 ,VC3. The normal flow would be that VC1 segues to VC2 and VC2 segues to VC3. The user has the option to unwind to VC2 from VC3. However, in one specific instance VC1 pushes to VC3. In this case the unwind segue to VC2 doesn't work. I would assume because VC2 never gets added to the stack of VCs. What other alternatives are there to perform the following: VC1->VC3->VC2. Is there anyway to add all view controllers in the chain to the stack when pushing to a view controller further down the chain? Thanks
Upvotes: 0
Views: 259
Reputation: 2165
I've used below approach on my app and it works fine.
vc2.navigationController.pushViewController(vc3, animated: true)
vc1.navigationController?.pushViewController(vc2, animated: true)
Upvotes: 0