title: Passing optional closure to the View
body: <p>I created a new subview containing a header for the other views.
  It has an arrow icon and i wanna pass a closure to this subview (profileClose is a function):</p>
  <pre><code>PlainHeader(title: getLocalizedText(&quot;edit profile&quot;), action: profileClose) 
  </code></pre>
  <p>The problem is I want this closure to be optional.. So i decided to wrap it into <code>() ? = nil</code> but after i did it every time i am using <code>PlainHeader(...)</code>. Xcode says <code>&quot;Extra argument 'action' in call&quot;</code></p>
  <pre><code>import SwiftUI
  
  struct PlainHeader: View {
      var title: String
      let action: (() -&gt; Void)? = nil
      
      var body: some View {
          
          VStack(spacing: 0) {
                          
              ZStack {
                  
                  VStack(spacing: 0) {
                      HStack {
                          Image(&quot;arrow-back&quot;)
                              .resizable()
                              .scaledToFit()
                              .frame(width: 18, height: 7)
                              .padding(.leading, 31)
                          Spacer()
                      }
                      .onTapGesture {
                          print(&quot;[debugUI] action called&quot;)
                          if self.action != nil {
                              self.action!()
                          }
                      }
                  }
                  VStack {
                      HStack {
                          Text(&quot;\(title)&quot;)
                              .lineLimit(nil)
                              .multilineTextAlignment(.center)
                              .frame(maxWidth: 280)
                              .font(.custom(Font.primaryTextFont, size: 20))
                              .foregroundColor(Color.mainSubtitleColor)
                      }
                  }
                  
              }
              .padding(.top, 20)
          }
          .frame(height: 80)
          
      }
  }
  </code></pre>
  <p>What am i doing wrong? I just wanna use it with and without closure.. so i set it as optional and give it a default value nil..</p>