Created
December 1, 2015 22:54
-
-
Save mortenjust/1faef7e499292d49c0b0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func selectFolder(){ | |
let openPanel = NSOpenPanel(); | |
openPanel.title = "Select a folder to watch for videos" | |
openPanel.message = "Videos you drop in the folder you select will be converted to animated gifs" | |
openPanel.showsResizeIndicator=true; | |
openPanel.canChooseDirectories = true; | |
openPanel.canChooseFiles = false; | |
openPanel.allowsMultipleSelection = false; | |
openPanel.canCreateDirectories = true; | |
openPanel.delegate = self; | |
openPanel.beginWithCompletionHandler { (result) -> Void in | |
if(result == NSFileHandlingPanelOKButton){ | |
let path = openPanel.URL!.path! | |
// do something | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment