title: Dismiss Modal UIViewController during handoff
body: <p>I'm trying to add handoff to my App. When my App is waken by Handoff I need to dismiss several ViewControllers to return to a MKMapView located in my view hierarchy.</p>
  
  <p>My view hierarchy looks like:</p>
  
  <p>+NavController</p>
  
  <p>+--- MyMapViewController (contains the MKMapView where I want to go, top of the NavController)</p>
  
  <p>+--- MyTabbarViewController (it's a tab bar with several views...)</p>
  
  <p>+--- MyOverviewViewController (pushed on the stack of my NacController by a VC that displayed in MyTabbarViewController)</p>
  
  <pre><code> +--- MyDetailViewController (it's a modal view presented by MyOverviewController)
  
   +--- MyChartViewController (it's a modal view presented by MyDetailViewController)
  </code></pre>
  
  <p>When the App receives the UserActivity the displayed view controller is "MyChartViewController".</p>
  
  <p>To show the result of the User Activity I need to go to the MyMapViewController to display some information on the MapView.</p>
  
  <p>My issue is to find a simple way to dismiss "MyChartViewController" and "MyDetailsViewController" before to call [navController popToRootViewControllerAnimated:TRUE];</p>
  
  <p>I tried [navController.visibleViewController dismissViewControllerAnimated:FALSE completion:Nil]; but it dismisses only the MyChartViewController, why?</p>
  
  <p>navController.visibleViewController is the MyDetailViewController.</p>
  
  <p>The only solution I found is to call:
   [MyChartViewController dismissViewControllerAnimated:FALSE completion:Nil];
  AND
   [navController.visibleViewController dismissViewControllerAnimated:FALSE completion:Nil];</p>
  
  <p>My view hierarchy can be more complex or different depending on where the user is located in the App when the UserActivity is triggered. I'm expecting to find a simple solution that could be used for any situation. The main issue is to dismiss the stack of modals viewController.</p>
  
  <p>I always want to go back to this MyMapViewController that is on the top of the NavController.</p>
  
  <p>Any idea?</p>
  
  <p>Thanks!</p>