Unwind then segue without showing intermediate view controller

前端 未结 1 1762
面向向阳花
面向向阳花 2021-01-16 14:26

I have three UIViewControllers where A -> B -> C, and A -> D.

When the user is done in C I want to unwind back to A and then segue to D, but I cannot ge

相关标签:
1条回答
  • 2021-01-16 14:51

    Try this Code in swift 3 :-

    let oldVCs = self.navigationController?.viewControllers
    var newVCs = [UIViewController]()
    
    // Add your root VC in new array of VCs
    newVCs.append(oldVCs![0])
    // Add your new VC just after your root VC
    newVCs.append("Your New VC")
    
    self.navigationController?.setViewControllers(newVCs, animated: true)
    
    0 讨论(0)
提交回复
热议问题