title: Dismiss or remove previous modally presented view controller as soon as the next one appear modally
body: <p>My target include a lot view need to present different view modally base on each user action. Here what I want to do to get cleaner view hierarchy and better user experience.</p>
  
  <blockquote>
    <ol>
    <li><strong><em>Root View Controller present First View Controller modally</em></strong></li>
    <li><strong><em>When I clicked button on the First View Controller, then the Second View Controller appear modally over it.</em></strong></li>
    <li><strong><em>As soon as the Second View Controller did appear, I want to dismiss or remove the first one from view hierarchy.</em></strong></li>
    </ol>
  </blockquote>
  
  <p>Can I do that? <strong>If so</strong>, how should i do it?</p>
  
  <p><strong>If not</strong>, what is the right way to solve this out cause I will present many modally presented view controllers over each view. I think even if I want to dismiss current view, the previous one will still remain appear when current one dismiss.</p>
  
  <p><strong>UPDATE :</strong> </p>
  
  <blockquote>
    <p><strong>VC1 (Root) > VC 2 (which was present modally) > VC 3 (which was</strong>
    <strong>present modally over VC 2)</strong></p>
  </blockquote>
  
  <p>When i dismiss <code>VC3</code>, the <code>VC2</code> is still on view memory. So, I don't want to appear <code>VC2</code> as soon as I dismiss <code>VC3</code> and instead I want to see <code>VC1</code> by removing or dismissing <code>VC2</code> from view hierarchy.</p>
  
  <p><a href="https://i.stack.imgur.com/TGMLr.gif" rel="noreferrer"><img src="https://i.stack.imgur.com/TGMLr.gif" alt="enter image description here"></a></p>
  
  <p><strong><em>WANT</em> : At the image, when I dismiss the blue,I don't want see the pink in my view memory and I want to remove it as soon as the blue one appear.</strong></p>
  
  <p>That's what i want to do.</p>
  
  <p>Any Help?Thanks.</p>