title: Trying to implement custom functionality to a SwiftUI button, keep getting a warning
body: <p>I am trying to make a custom button where I can implement my own functionality, like in the example below:</p>
  <pre><code>MSButton {
      print(&quot;hello&quot;)
  }
  </code></pre>
  <p>Problem is, I keep getting the <code>Expression of type '(() -&gt; Void)?' is unused</code> warning, and the functionality I add doesn't activate.</p>
  <p>Here is the code I made in an attempt to implement this:</p>
  <pre><code>struct MSButton: View {
      
      var action: (() -&gt; Void)?
      
      var body: some View {
          Button() {
              action // where I am getting the warning.
          } label: {
              Text(&quot;Button&quot;)
          }
      }
  }
  </code></pre>
  <p>What am I missing that would allow me to get my <code>action</code> to work properly? Any help would be greatly appreciated.</p>