You should be able to just call terminate on the global NSApp object.
Swift 4 & 5:
@IBAction func ExitNow(sender: AnyObject) {
NSApplication.shared.terminate(self)
}
Swift 3:
@IBAction func ExitNow(sender: AnyObject) {
NSApplication.shared().terminate(self)
}
Swift 2:
@IBAction func ExitNow(sender: AnyObject) {
NSApplication.sharedApplication().terminate(self)
}