【发布时间】:2021-04-08 01:58:09
【问题描述】:
我的 Storyboard 中有这样的内容: 导航控制器 -> A -> B -> C 其中 A、B 和 C 是 ViewController。我住在 C 中,我有代表 B 控制器的变量并执行以下操作:
controllerB?.navigationController?.popViewController(animated: true)
self.navigationController?.popViewController(animated: true)
应该先关闭 B 控制器然后关闭 C。但是当我在模拟器中执行此操作时,我看到 C 控制器首先被关闭,之后我看到 B 控制器一段时间后它也被关闭。 我尝试过这样的延迟:
DispatchQueue.main.asyncAfter(deadline: .now() + 5.0)
但它也不起作用 你能帮助我吗?甚至有可能在 C 之前解雇 B 吗?
【问题讨论】:
标签: ios swift uiviewcontroller uinavigationcontroller