How to dismiss a navigation controller presented from another navigation controller in iOS 10 and below?

夙愿已清 提交于 2019-12-13 20:08:24

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!