Skip to content

Instantly share code, notes, and snippets.

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() {
self.window?.level = Int(CGWindowLevelForKey(CGWindowLevelKey.ModalPanelWindowLevelKey))
@IBAction func close(sender: AnyObject!) {
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.