4

I am trying to open a specific view controller by tapping a button on my today extension. But it only takes me to my initial view controller but I need to go to my second view controller. Here is my code when the button taps

 @IBAction func myButton(_ sender: Any)
{
    self.extensionContext?.open(URL(string: "car://")!, completionHandler: nil)
}

Here is what I also have in AppDelegate

func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool
{
    if url.scheme == "car://"
    {

    }
    return true
}

I also have my URL types set to "car"

Any help will be greatly appreciated!

Nathan Lorenz
  • 153
  • 1
  • 11
  • the solution depend more on your application structure. and where in the hierarchy you wonna show that controller. easiest way is to create an instance for it and then set to self.window?.rootViewController in appDelegate. but that makes this controller is your start controller and you can't go back to other as you expected. – hasan Mar 15 '18 at 11:09

0 Answers0