title: Suggestions for popping complex navigation path to root (path includes multiple nested UINavigationControllers and modal overlays)
body: <p>I'm working on an application that includes relatively complex navigation paths through a storyboard of views.  The scenario is, I have a UINavigationController with a number of controllers, each of which can potentially present modals that themselves have UINavigationCollers which have their own sets of controllers that can present modals, etc. etc. etc.  My problem is that I need a general way to essentially cancel out and pop all the way back up to the root view controller.  </p>
  
  <p>Would you suggest a mechanical approach that backtracks view controllers via a mix of  popToRootViewControllerAnimated and dismissViewControllerAnimated calls?  Or is there an easier way to jump back to my root given this complex path?</p>
  
  <p>This feels like it would be a common problem.  Any suggestions would be much appreciated!  </p>
  
  <p>Note, I've seen related questions - I already know how to perform the necessary steps to pop the controllers when the path is known.  What I'm looking for is a way to do this in a general way.  </p>
  
  <p>Thanks!</p>