title: Dismiss a SwiftUI View that is contained in a UIHostingController
body: <p>I have rewritten my sign in view controller as a SwiftUI <code>View</code>. The <code>SignInView</code> is wrapped in a <code>UIHostingController</code> subclass (<code>final class SignInViewController: UIHostingController&lt;SignInView&gt; {}</code>), and is presented modally, full screen, when sign in is necessary.</p>
  
  <p>Everything is working fine, except I can't figure out how to dismiss the <code>SignInViewController</code> from the <code>SignInView</code>. I have tried adding:</p>
  
  <pre><code>@Environment(\.isPresented) var isPresented
  </code></pre>
  
  <p>in <code>SignInView</code> and assigning it to <code>false</code> when sign in is successful, but this doesn't appear to interop with UIKit. How can I dismiss the view?</p>