What I want to do is:
VC1 -> present VC2 -> push VC3
this is the normal flow I want to make.
after that on back button(on each VC have back button)
I required to show user as moving back:
VC3 -> present VC2 -> VC1
How do I achieve this kind of navigation in Swift 5?
//VC1
@IBAction func presentVC2() {
let vc2 = VC2()
vc2.modalPresentationStyle = .fullScreen
self.present(vc2, animated: true, completion: nil)
}
//VC2
@IBAction func presentVC3() {
let vc3 = VC3()
let navController = UINavigationController(rootViewController: vc3) //Add navigation controller
navController.modalPresentationStyle = .fullScreen
self.present(navController, animated: true, completion: nil)
}
//VC3
@IBAction func navigationVC4() {
let vc4 = VC4()
self.navigationController?.pushViewController(vc4, animated: true)
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With