title: Go from third of forth view controller to root view controller swift
body: <p>I have 3 view controllers, presented modally, how do I dismiss the view controllers and go directly from the third right back to the first (root) view controller. </p>
  
  <p>Basically, when I call <code>dismissViewControllerAnimated</code> from the third I want it to also dismiss the underlying second view controller and return straight to the first view, releasing the others from memory. </p>
  
  <p>EDIT</p>
  
  <p>Simply, want to go from the third view on the right, back to the first without having to go through and dismiss the middle on. Obviously I can't just present the first one form the third, as thats a massive memory leak.</p>
  
  <p><img src="https://i.stack.imgur.com/v8eD1.png" alt="enter image description here"></p>