Launching ViewController from AppDelegate

后端 未结 6 2059
情书的邮戳
情书的邮戳 2021-02-03 09:51

I have a custom URL scheme and i want to open a certain ViewController which is not the root when i go to this URL. I have been able to do that and what remains is

6条回答
  •  走了就别回头了
    2021-02-03 10:38

    For Swift 3 version:

    let mainStoryboardIpad : UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
    let initialViewControlleripad : UINavigationController = mainStoryboardIpad.instantiateViewController(withIdentifier: "initial") as! UINavigationController
    self.window = UIWindow(frame: UIScreen.main.bounds)
    self.window?.rootViewController = initialViewControlleripad
    self.window?.makeKeyAndVisible()
    

提交回复
热议问题