new updates for paddel
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import AppKit
|
||||
|
||||
@MainActor
|
||||
enum FilePicker {
|
||||
static func chooseDirectory() -> String? {
|
||||
let panel = NSOpenPanel()
|
||||
panel.canChooseDirectories = true
|
||||
panel.canChooseFiles = false
|
||||
panel.allowsMultipleSelection = false
|
||||
panel.canCreateDirectories = true
|
||||
return panel.runModal() == .OK ? panel.url?.path : nil
|
||||
}
|
||||
|
||||
static func chooseFile() -> String? {
|
||||
let panel = NSOpenPanel()
|
||||
panel.canChooseDirectories = false
|
||||
panel.canChooseFiles = true
|
||||
panel.allowsMultipleSelection = false
|
||||
return panel.runModal() == .OK ? panel.url?.path : nil
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user