title: Catch when user drags down modal in iOS Swift
body: <p>Im trying to get the same behaviour as Apple has done in it's calendar app for iOS15 (possibly in earlier versions as well) were if you try to dismiss the view you will get presented an <strong>Action Sheet</strong> asking if you want to discard you changes.</p>
  <p>So what I want is to be able to somehow catch the event were the user tries to drag down the view and for example check:</p>
  <pre><code>if hasChanges {
  // Show Action sheet &amp; stop view from disappearing 
  }
  </code></pre>
  <p>This doesn't work as I wan't to in viewWillDisappear as the view just disappears before I get to present the Action Sheet</p>
  <p><a href="https://i.stack.imgur.com/NxpSb.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NxpSb.jpg" alt="enter image description here" /></a></p>