模态上的不平衡调用警告存在然后导航在完成时弹出到根

时间:2018-05-30 05:18:44

标签: ios swift uikit

获取以下代码(从导航堆栈中的任何给定视图控制器调用)。

func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {

    let vc = MyViewController()
    present(vc, animated: true) {
        self.navigationController?.popToRootViewController(animated: false)
    }
}

现在,这非常有效,一切都符合预期。但是,我收到以下警告。

Unbalanced calls to begin/end appearance transitions for <MyApp.MyViewController: 0x1044276d0>.

因此,如果打印出警告,当用户解除从导航堆栈中任何给定视图控制器呈现的模态视图控制器时,是否有更好的方法让用户位于导航堆栈的根目录?

0 个答案:

没有答案