title: Dismiss all modals in iOS with Swift 4
body: <p>I am trying to achieve a navigation similar to the Netflix app for iOS. When you click on a movie, a modal window pops up with a close button. If within this movie I choose to see another movie then the second modal pops up and in addition to the close button, a back button appears. I can use the back button to dismiss one by one and the close button to return to the base screen.</p>
  
  <p>I am able to dismiss a single view using </p>
  
  <pre><code>dismiss(animated: true, completion: nil)
  </code></pre>
  
  <p>but how can I return to the base screen closing all modals at once? Also, is modals the way to go? I chose this because I didn't want the navigation bar on top.</p>
  
  <p>I'm working with Swift 4.2 in Xcode 10.</p>