【发布时间】:2018-11-01 02:51:57
【问题描述】:
(我需要当前的 vc 而不是推送 vc)
我有一个标签栏和一个导航控制器界面
我的第一个标签栏项目 vc1 和第二个标签栏项目是 vc2
push vc 工作正常,这就是我所做的 第 1 步-我单击 vc1 中的一个按钮,该按钮通过导航推送将我导航到 vc3
接下来我点击了 vc2 选项卡项 然后我点击 vc1 标签项和 然后我按下 vc3 的 BACK 按钮,我得到的是正确的应用程序流程
后退按钮弹出视图控制器
fileprivate func presentDetail(at indexPath: IndexPath) {
self.updateCell(at: indexPath)
self.startLoading()
let vc3 = storyboard?.instantiateViewController(withIdentifier: "vc3") as! vc3
// self.navigationController?.setViewControllers([vc,vc1], animated: true)
vc3.modalPresentationStyle = .overCurrentContext
vc3.data = mDataSource.shared.demoData[indexPath.row]
if let navigator = navigationController {
navigator.pushViewController(vc3, animated: true)
}
@IBAction func backBtnTapped(_ sender: Any) {
self.navigationController?.popViewController(animated: true)
// performSegue(withIdentifier: "unwindSegueToVC1", sender: self)
}
如何让目前的 VC 工作?
let vc = storyboard.instantiateViewController(withIdentifier: "vc3") as! vc3
vc3.modalPresentationStyle = .overCurrentContext
vc3.data = mDataSource.shared.demoData[indexPath.row]
self.present(vc, animated: true, completion: nil)
【问题讨论】:
标签: ios uinavigationcontroller uitabbarcontroller swift4