title: How to present a modal view controller like with UIKit's UIViewControllerTransitioningDelegate?
body: <p>I am switching from UIKit to SwiftUI and still struggle to understand some parts of it, especially the transitions between views.</p>
  <p>I have a situation where is displayed on screen a view controller with a list, say <code>ElementsListViewController()</code>, and when tapping an element I want to display a modal with a custom UI/animation: the opaque overlay would appear with an animation of the alpha value while the white modal &quot;sheet&quot; would appear from bottom to top.</p>
  <p>Here is what it looks like:</p>
  <p><a href="https://i.stack.imgur.com/pRC6d.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pRC6d.gif" alt="enter image description here" /></a></p>
  <p>With UIKit, I would use <code>UIViewControllerAnimatedTransitioning</code> to do that.</p>
  <p>Now I would like to do the same with SwiftUI, but I am lost with what to do exactly here.</p>
  <p>I have this so far:</p>
  <pre><code>@main
  struct MyApp: App {
      var body: some Scene {
          WindowGroup {
              ElementsList()
          }
      }
  }
  
  struct ElementsList: View {
      @State var elements: [String] = (0..&lt;100).map { &quot;Element #\($0)&quot; }
  
      var body: some View {
          List(elements, id: \.self) {
              Text($0)
                  .onTapGesture {
                      // what to do here to display ModalView as I want to?
                  }
          }
          .listStyle(PlainListStyle())
      }
  }
  
  struct ModalView: View {
      var body: some View {
          ZStack {
              Color.black.opacity(0.8)
              Color.white
                  .cornerRadius(20.0)
                  .padding(.top, 150)
          }
          .ignoresSafeArea()
      }
  }
  </code></pre>
  <p>What is my best option here?  Thank you for your help</p>