title: Send tapAction from SwiftUI button action to UIView function
body: <p>I'm trying to find a way to trigger an action that will call a function in my <code>UIView</code> when a button gets tapped inside <code>swiftUI</code>. </p>
  
  <blockquote>
    <p>Here's my setup: </p>
  </blockquote>
  
  <p><em><code>foo()(UIView)</code> needs to run when <code>Button(SwiftUI)</code> gets tapped</em></p>
  
  <h3>My custom UIView class making use of AVFoundation frameworks</h3>
  
  <pre class="lang-swift prettyprint-override"><code>class SomeView: UIView {
  
      func foo() {}
  }
  </code></pre>
  
  <h3>To use my UIView inside swiftUI I have to wrap it in <code>UIViewRepresentable</code></h3>
  
  <pre class="lang-swift prettyprint-override"><code>struct SomeViewRepresentable: UIViewRepresentable {
  
      func makeUIView(context: Context) -&gt; CaptureView {
          SomeView()
      }
  
      func updateUIView(_ uiView: CaptureView, context: Context) {        
      }
  }
  </code></pre>
  
  <h3>SwiftUI View that hosts my UIView()</h3>
  
  <pre class="lang-swift prettyprint-override"><code>struct ContentView : View {
  
      var body: some View {
          VStack(alignment: .center, spacing: 24) {
              SomeViewRepresentable()
                  .background(Color.gray)
              HStack {
                  Button(action: {
                      print("SwiftUI: Button tapped")
                     // Call func in SomeView()
                  }) {
                      Text("Tap Here")
                  }
              }
          }
      }
  }
  </code></pre>