title: NSButton Event Handling in Xcode 6 with Swift
body: <p>I want to set the action and target for an NSButton in swift. In previous versions of Xcode, there were setAction and setTarget methods, but those aren't included in the Cocoa library anymore (or they aren't as far as I can tell). What is the equivalent in Swift with the new library for for:</p>
  
  <pre><code>    NSButton *myButton = [NSButton alloc];
      [myButton setTarget:self];
      [myButton setAction:@selector(myMethodToCallOnClick:)];
  </code></pre>