title: How to determine whether the UILocalNotification is tapped without checking application state?
body: <p>I am creating an app which should open specific view controller when I tap on UILocalNotification. My code is :</p>
  
  <pre><code>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
  
    if application.applicationState == UIApplicationState.Inactive
    {
       root.presentViewController(setview, animated:false , completion: nil)
    }
  }
  </code></pre>
  
  <p>TapViewController is displayed even if I don't tap on notification when I pull down the notification centre from my app,because the application state is changing from inactive to active when I do so.</p>
  
  <p>So how can I detect whether the notification is tapped in this case? What is the condition to check along with application state?</p>