macOS 点击关闭按钮立即退出程序&Dock上不显示icon的

2019-06-17  本文已影响0人  mapg

 //点击红色关闭按钮退出程序
    func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
        return true
    }

image.png

在配置文件里面添加Application is agent (UIElement) 并设置他的值为true即可

上一篇 下一篇

猜你喜欢

热点阅读