I'm trying to show NSSavePanel (or any "Save File Dialog") on Mac OSX. I'm building COCOA application in XCode Version 9.3 (9E145) in Swift 4 (or 4.2? I'm not sure exactly).
I've tried everything...
Like this?
let savePanel = NSSavePanel()
savePanel.begin { (result) in
if result.rawValue == NSApplication.ModalResponse.OK.rawValue {
}
}
this?
let savePanel = NSSavePanel()
savePanel.canCreateDirectories = true
savePanel.showsTagField = false
savePanel.nameFieldStringValue = "result.csv"
savePanel.level = NSWindow.Level(rawValue: Int(CGWindowLevelForKey(.modalPanelWindow)))
savePanel.begin { (result) in
if result.rawValue == NSApplication.ModalResponse.OK.rawValue {
}
}
many many other ways...
What am I missing? Thanks!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.