ViewController.swift
class ViewController: NSViewController , NSWindowDelegate { override func viewDidAppear() { self.view.window?.delegate = self //self.view.window?.styleMask.remove(.resizable) //self.view.window?.styleMask.remove(.closable) //self.view.window?.styleMask.remove(.titled) //self.view.window?.styleMask = [.titled, .miniaturizable] //self.view.window?.styleMask.remove(.fullSizeContentView) } func windowShouldClose(_ sender: NSWindow) -> Bool { // true == close // false == not close return false; } func onHideLogin(){ self.view.window?.orderOut(self) // self.view.window?.close() } func onLogoutView(){ self.view.window?.orderBack(self) } override func viewDidLoad() { } }