let dialog = NSOpenPanel();
dialog.title = "Choose a file| Our Code World";
dialog.showsResizeIndicator = true;
dialog.showsHiddenFiles = false;
if (dialog.runModal() == NSApplication.ModalResponse.OK) {
let result = dialog.url // Pathname of the file
if (result != nil) {
let path: String = result!.path
} else {
// User clicked on "Cancel"
return
}
</pre>