title: How to get notified when a presented view controller is dismissed with a gesture?
body: <p>It is possible in some cases (iPhone X, iOS 13) to dismiss presented view controllers with a gesture, by pulling from the top.</p>
  
  <p>In that case, I can't seem to find a way to notify the presenting view controller. Did I miss something?</p>
  
  <p>The only I found would be to add a delegate method to the viewDidDisappear of the presented view controller.</p>
  
  <p>Something like:</p>
  
  <pre class="lang-swift prettyprint-override"><code>class Presenting: UIViewController, PresentedDelegate {
      func someAction() {
          let presented = Presented()
          presented.delegate = self
          present(presented, animated: true, completion: nil)
      }
      func presentedDidDismiss(_ presented: Presented) {
          // Presented was dismissed
      }
  }
  
  protocol PresentedDelegate: AnyObject {
      func presentedDidDismiss(_ presented: Presented)
  }
  
  class Presented: UIViewController {
      weak var delegate: PresentedDelegate?
  
      override func viewDidDisappear(animated: Bool) {
           ...
           delegate?.presentedDidDismiss(self)
      }
  }
  </code></pre>
  
  <p>It is also possible to manage this via notifications, using a vc subclass but it is still not satisfactory.</p>
  
  <pre class="lang-swift prettyprint-override"><code>
  extension Notification.Name {
      static let viewControllerDidDisappear = Notification.Name("UIViewController.viewControllerDidDisappear")
  }
  
  open class NotifyingViewController: UIViewController {
  
      override open func viewDidDisappear(_ animated: Bool) {
          super.viewDidDisappear(animated)
  
          NotificationCenter.default.post(name: .viewControllerDidDisappear, object: self)
      }
  }
  </code></pre>
  
  <p>There must be a better way to do this?</p>