title: Swift use selector argument like a closure
body: <p>I was just wondering if it was possible to pass a function to a button action (which is usually a selector).</p>
  
  <p>For example, normally I'd say:</p>
  
  <pre><code>UIBarButtonItem(title: "Press", style: .Done, target: self, action: "functionToCall")
  
  func functionToCall() {
      // Do something
  }
  </code></pre>
  
  <p>But I was wondering if it's possible to do something like:</p>
  
  <pre><code>UIBarButtonItem(title: "Press", style: .Done, target: self, action: {
      // Do Something
  })
  </code></pre>
  
  <p>Reason I want to do this is because my function is super simple and it seems like it would be neater and more Swift-like what with the emphasis they are placing on closures.</p>