How to made a leave button in a macOS app in Xcode

I am building an app and I would like to know how to made a button to leave my app. For now on Xcode I but the button + and I add my button to the app but I need to enter the action and I don't now the command for made a button «leave the app».

Someone can help me?

Accepted Answer

You can do this, in the button action:

    @IBAction func quitMe(_ sender: NSButton) {
        NSApp.terminate(self)
    }
How to made a leave button in a macOS app in Xcode
 
 
Q