title: Why dismissing a UIAlertController calls dismiss on UINavigationController?
body: <p>I'm trying to understand why when dismissing a UIAlertController from a view controller presented in a navigation calls the <code>dimiss(animetaded:)</code> on the UINavigationController.</p>
  
  <p>The reason is that I have inherited from UINavigationController to add some logic to when the navigation is dismissed but it is unintentionally called every time an alert is dismissed.</p>
  
  <p>In my understanding the <em>presentingViewController</em> is responsible for dismissing a presented controller but it seems that this is not the case here.</p>
  
  <p>What am I missing?</p>
  
  <p>To reproduce, run then code below and it will log the message "DISMISS ON NAVIGATION".</p>
  
  <pre><code>    class RootViewController: UIViewController {
          override func viewDidAppear(_ animated: Bool) {
              super.viewDidAppear(animated)
  
              let alert = UIAlertController(title: "", message: "", preferredStyle: .actionSheet)
              alert.addAction(UIAlertAction(title: "cancel", style: .cancel, handler: nil))
              present(alert, animated: true)
          }
      }
  
      class Nav: UINavigationController {
          override func dismiss(animated flag: Bool, completion: (() -&gt; Void)? = nil) {
              print("DISMISS ON NAVIGATION")
              super.dismiss(animated: flag, completion: nil)
          }
      }
  </code></pre>
  
  <p>Now present the navigation controller from anywhere.</p>
  
  <pre><code>            let contrl = RootViewController()
              contrl.view.backgroundColor = .red
              contrl.definesPresentationContext = true
  
              let nav = Nav(rootViewController: contrl)
  
              present(nav, animated: true, completion: nil)
  </code></pre>
  
  <p>Edit: Updated code to make <em>RootViewController</em> define a presentation context. 
  Edit2: Update code to better represent the scenario.</p>