0
私のタブバーコントローラの2番目の項目では、私はモーダルで提示したいナビゲーションコントローラを持っています。アプリケーションがアクティブなコントローラをモーダルに表示しようとしました - ナビゲーションコントローラ
未知の例外 'NSInvalidArgumentException'が原因でアプリケーションを終了しています。理由: 'アプリケーションがアクティブなコントローラをモーダルに表示しようとしました。'
次に、アプリケーションがクラッシュし、アプリケーションデリゲートに移動します。
これは、これまで
func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool {
if let restoreID = viewController.restorationIdentifier {
if restoreID == "NavigationCamera" {
if let nav = tabBarController.viewControllers![tabBarController.selectedIndex] as? UINavigationController {
print("Nav is allowed")
//let newVC = tabBarController.storyboard?.instantiateViewController(withIdentifier: "CameraView")
tabBarController.present(nav, animated: true, completion: {
print("complete")
})
return false
}
}
}
return true
}