问题
I'm presenting a UINavigationController
from another UINavigationController
like this:
let customNavigationController = CustomNavigationController()
customNavigationController.viewControllers = [myController]
customNavigationController.modalPresentationStyle = .custom
self.navigationController.present(customNavigationController, animated: true, completion: nil)
Then, when a "close" button tapped, I try to dismiss it like this:
navigationController.dismiss(animated: true, completion: nil)
That works on iOS 11
, but it is not working neither in iOS 9
nor iOS 10
. What I'm missing or doing wrong?
来源:https://stackoverflow.com/questions/47267884/how-to-dismiss-a-navigation-controller-presented-from-another-navigation-control