title: Function with optional completion block in Swift
body: <p>When I create a function, I can make a parameter optional by giving it a default value, like this:</p>
  
  <pre><code>func foo(bar: String = "foobar") {}
  </code></pre>
  
  <p>I want to do the same (make it optional) with a completion block. I have tried the following:</p>
  
  <pre><code>func foo(completionBlock: (foo: String) -&gt; () = () -&gt; ())
  func foo(completionBlock: (foo: String) -&gt; () = (foo: String) -&gt; ())
  func foo(completionBlock: (foo: String) -&gt; () = ((foo: String) -&gt; ()))
  func foo(completionBlock: (foo: String) -&gt; () = ((foo: String) in))
  func foo(completionBlock: (foo: String) -&gt; () = {(foo: String) in})
  </code></pre>
  
  <p>How can I do this?</p>
  
  <p><strong>EDIT:</strong> <br>This is/was a duplicate question, sorry for that. However, I couldn't find the solution in the original question. So nathan's answer is the best one</p>