Ios 3D触控快速行动在启动swift 3时崩溃

Ios 3D触控快速行动在启动swift 3时崩溃,ios,3d,swift3,3dtouch,Ios,3d,Swift3,3dtouch,在对UI进行更改之前,我实现了3D触摸,我所做的只是将ViewController嵌入到导航控制器中。在这些更改之后,每次我尝试使用3D touch启动应用程序时,我的快速添加3D快捷方式都会导致应用程序崩溃。如果我定期启动该应用程序,该应用程序工作正常 以下是我的appDelegate代码: func application(_ application: UIApplication, performActionFor shortcutItem: UIApplicationShortcutIt

在对UI进行更改之前,我实现了3D触摸,我所做的只是将ViewController嵌入到导航控制器中。在这些更改之后,每次我尝试使用3D touch启动应用程序时,我的快速添加3D快捷方式都会导致应用程序崩溃。如果我定期启动该应用程序,该应用程序工作正常

以下是我的appDelegate代码:

func application(_ application: UIApplication, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void) {
    if shortcutItem.type == "com.krp.addEvent" {
        let sb = UIStoryboard(name: "Main", bundle: nil)
        let addEventVC = sb.instantiateViewController(withIdentifier: "addEventVC") as! ViewController
        let root = UIApplication.shared.keyWindow?.rootViewController
        root?.present(addEventVC, animated: false, completion: { () -> Void in completionHandler(true)})
    }
}

调试控制台中的错误是什么?奇怪的是,它现在没有给我错误,而是给我这个警告。。2017-04-06 14:08:24.919742晨星2[23436:5882367]警告:尝试在其视图不在窗口层次结构中的位置显示!来自调试器的消息:由于信号9而终止