I am trying to create an app which fires a local notification and when the notification is tapped, a specific viewcontroller
should be opened. I used didReceiveLocalNotification
method to display a specific view controller. But that specific view controller is being displayed even when I dismiss the notification from notification centre.
What method is triggered when we dismiss the notification?
Here is the code I used:
func application(application: UIApplication!,didReceiveLocalNotification notification: UILocalNotification)
{
var root = self.window!.rootViewController as ViewController
let main: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
var setview = main.instantiateViewControllerWithIdentifier("destination") as tapViewController
//root.navigationController?.popToViewController(setview, animated: false)
if application.applicationState == UIApplicationState.Inactive
{
root.presentViewController(setview, animated:false , completion: nil)
}
}