0
我有以下结构:如何解雇overCurrentContext模态viewController及其子项?
从
mainVC
我提出一个模式的viewController,modalVC
:let modalVC: ModalVC = ModalVC() modalVC.modalPresentationStyle = .overCurrentContext modalVC.modalTransitionStyle = .coverVertical self.present(modalVC, animated: false, completion: nil)
从
modalVC
我提出了另一个的viewControllerchatVC
,但这次没有.overCurrentContext
选项:let chatVC: ChatVC = ChatVC() self.present(chatVC, animated: false, completion: nil)
在这一点上,我有以下几点:
mainVC
--present模态 - >modalVC
--present - >chatVC
我要解雇chatVC
和modalVC
再次显示mainVC
。
我想:
self.presentingViewController?.presentingViewController?.dismiss(animated: false, completion: nil)
没有成功。
任何想法?在此先感谢
确保self.presentingViewController?.presentingViewController是mainVC。 – HMHero