Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Showing any NSWindowController as an app modal
class ModalDialogController: NSWindowController {
convenience init() {
self.init(windowNibName: "ModalDialogController")
}
@IBOutlet var closeButton: NSButton!
override func windowDidLoad() {
super.windowDidLoad()
self.window?.level = Int(CGWindowLevelForKey(CGWindowLevelKey.ModalPanelWindowLevelKey))
}
@IBAction func close(sender: AnyObject!) {
self.close()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.