title: Presenting UIActivityViewController from SwiftUI View
body: <p>I'm trying to present a <code>UIActivityViewController</code> (share sheet) from a SwiftUI View. I created a view called <code>ShareSheet</code> conformed to <code>UIViewControllerRepresentable</code> to configure the <code>UIActivityViewController</code>, but it's turning out to be not as trivial to actually present this.</p>
  
  <pre><code>struct ShareSheet: UIViewControllerRepresentable {
      typealias UIViewControllerType = UIActivityViewController
  
      var sharing: [Any]
  
      func makeUIViewController(context: UIViewControllerRepresentableContext&lt;ShareSheet&gt;) -&gt; UIActivityViewController {
          UIActivityViewController(activityItems: sharing, applicationActivities: nil)
      }
  
      func updateUIViewController(_ uiViewController: UIActivityViewController, context: UIViewControllerRepresentableContext&lt;ShareSheet&gt;) {
  
      }
  }
  </code></pre>
  
  <p>Doing so naively via <code>.sheet</code> leads to the following.</p>
  
  <pre><code>.sheet(isPresented: $showShareSheet) {
      ShareSheet(sharing: [URL(string: "https://example.com")!])
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/9o7Hc.png" rel="noreferrer"><img src="https://i.stack.imgur.com/9o7Hc.png" alt="screenshot of failed controller presentation"></a></p>
  
  <p>Is there a way to present this like it's usually presented? As in covering half the screen?</p>