I have been trying to open a specific view on my App when a push notifications arrives, but this view is being presented modally by a detailed view of a split view and I haven't been able to do it.
I have tried one of the many answers that are on the topic which is just presenting EventsViewController, but clearly this way leaves the VC isolated and no longer connected to the split view.
func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject]) {
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let navigationController = storyboard.instantiateViewControllerWithIdentifier("NavigationControllerMessages") as! UINavigationController
let dVC:MessagesViewController = navigationController.topViewController as! MessagesViewController
dVC.vehicleLicensePlate = "ABC"
dVC.vehicleName = "My car"
self.window?.rootViewController?.presentViewController(navigationController, animated: true, completion: {})
}
Also I have tried presenting the split view which actually works but I don't know how to climb the hierarchy view to get to EventsViewController:
func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject]) {
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let destinationViewController = storyboard.instantiateViewControllerWithIdentifier("SplitInStoryboard") as! SplitViewController
self.window?.rootViewController?.presentViewController(destinationViewController, animated: true, completion:nil)
}
The question is how to present EventsViewController so I can connect all the views between the root view controller and my view?
Hope anyone can help me, please. I have been struggling with this for many hours. Thanks in advance!