AppDelegate或button action中调用以编程方式切换全屏模式吗?
我也想知道在动作中以及在AppDelegate中执行此操作的最有效方法。class AppDelegate: NSObject, NSApplicationDelegate {
var window: NSWindow!
func applicationDidFinishLaunching(_ aNotification: Notification) {
self.window.toggleFullScreen(nil)
self.window.makeKey()
}
}