当前位置: 动力学知识库 > 问答 > 编程问答 >

ios - How to load the whole app when using 3D touch to access specific View

问题描述:

I have a 3D touch quick action that accesses a specific viewcontroller in my app.

 let mainStoryboard : UIStoryboard = UIStoryboard(name: "Main", bundle: nil)

let initialViewController : UIViewController = mainStoryboard.instantiateViewController(withIdentifier: "newCardVC") as! ViewController

self.window = UIWindow(frame: UIScreen.main.bounds)

self.window?.rootViewController = initialViewController

self.window?.makeKeyAndVisible()

The problem I'm facing is that although the specified viewcontroller does appear, and other viewcontrollers that are "children" (meaning you segue from this vc to them) are also appearing and working, the "parent" viewcontroller is not loaded. Therefore my dismiss viewcontroller and other methods are not working. How do I load all the viewcontrollers in my app, although I'm 3D quick action accessing my 3rd vc in vc hierarchy ?

Thanks .

分享给朋友:
您可能感兴趣的文章:
随机阅读: