我正在尝试将一个视图控制器不带动画地移动到另一个:
viewController.dismiss(animated: false, completion: nil)
// viewController.presentingViewController != nil here
tabBarController.present(viewController, animated: false, completion: nil)
运行此代码时,我崩溃了:Application tried to present modally an active controller
答案 0 :(得分:1)
您可以将当前零件放入dismiss调用的完成处理程序中
viewController.dismiss(animated: false) {
tabBarController.present(viewController, animated: false, completion: nil)
}