title: quitting xcode cocoa swift app
body: <p>I have written my first swift OS/X application in XCode 6. It all works except I cannot figure out how to exit the app.  I have a button to exit and the <code>ExitNow</code> function defined as follows:</p>
  
  <pre><code>@IBAction func ExitNow(sender: AnyObject) {
      // ???
  }
  </code></pre>
  
  <p>I cannot figure out what the code would be.  By searching online I've found various options, but they were either in Objective C or too general for me to comprehend. I would appreciate an example which would behave the same way as <code>cmd-Q</code>.</p>