I've a MainTabBarController
with multiple controllers.
In my FirstTabViewController
(embed in UINavigationController
) I pushed to another View Controller, like: navigationController?.pushViewController(secondViewController, animated: true)
.
In this controller, I've to show a modal view controller, like:
let vc = self.storyboard!.instantiateViewController(withIdentifier: "SomeViewController") as! SomeViewController
vc.modalPresentationStyle = .overFullScreen
vc.modalTransitionStyle = .coverVertical
let nav = UINavigationController(rootViewController: vc)
self.present(nav, animated: true, completion: nil)
And in the SomeViewController
, I've to dismiss this controller like: self.dismiss(animated: true)
but it pop automatically to root view controller (FirstTabViewController
).
My question, why ?
Thanks.