【发布时间】:2018-09-11 19:12:36
【问题描述】:
如何在快速从导航控制器中解散后呈现另一个视图控制器?
我正在使用导航控制器。
ViewController1.swift
func pushTo(viewController: UIViewController) {
let showLocalPwd = self.storyboard?.instantiateViewController(withIdentifier: "LocalPwdVC") as! LocalPwdVC
self.navigationController?.present(showLocalPwd, animated: true, completion: nil)
}
ViewController2.swift
@IBAction func btnVerify(_ sender: Any)
{
self.dismiss(animated: true, completion: {
let vc = self.storyboard.instantiateViewController(withIdentifier: "DataVC") as! DataVC
self.navigationController.pushViewController(vc, animated: true)
})
}
关闭视图控制器后,它不会转到下一个视图控制器,即 DataVC
【问题讨论】:
-
请发布您当前的代码
-
那么你需要使用委托方法来实现这个
-
我添加了代码
标签: ios swift uinavigationcontroller