title: Prevent dismissal of modal view controller in SwiftUI
body: <p>At WWDC 2019, Apple announced a new "card-style" look for modal presentations, which brought along with it built-in gestures for dismissing modal view controllers by swiping down on the card. They also introduced the new <code>isModalInPresentation</code> property on <code>UIViewController</code> so that you can disallow this dismissal behavior if you so choose.</p>
  
  <p>So far, though, I have found no way to emulate this behavior in SwiftUI. Using the <code>.presentation(_ modal: Modal?)</code>, does not, as far as I can tell, allow you to disable the dismissal gestures in the same way. I also attempted putting the modal view controller inside a <code>UIViewControllerRepresentable</code> <code>View</code>, but that didn't seem to help either:</p>
  
  <pre><code>struct MyViewControllerView: UIViewControllerRepresentable {
      func makeUIViewController(context: UIViewControllerRepresentableContext&lt;MyViewControllerView&gt;) -&gt; UIHostingController&lt;MyView&gt; {
          return UIHostingController(rootView: MyView())
      }
  
      func updateUIViewController(_ uiViewController: UIHostingController&lt;MyView&gt;, context: UIViewControllerRepresentableContext&lt;MyViewControllerView&gt;) {
          uiViewController.isModalInPresentation = true
      }
  }
  </code></pre>
  
  <p>Even after presenting with <code>.presentation(Modal(MyViewControllerView()))</code> I was able to swipe down to dismiss the view. Is there currently any way to do this with existing SwiftUI constructs?</p>