Created
July 22, 2017 02:51
-
-
Save staycreativedesign/b48d8ab919faafb28d8d85f8efb6c0b5 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
// if directory exists skip | |
// else | |
//create directory | |
createDirectory(name: "cabecao/decks/comida/") | |
func createDirectory(name: String) { | |
let fm = FileManager.default | |
let dirPath = fm.urls(for: .documentDirectory, in: .userDomainMask) | |
let docsURL = dirPath[0] | |
let deckPath = docsURL.appendingPathComponent(name) | |
do { | |
try fm.createDirectory(at: deckPath, withIntermediateDirectories: true, attributes: nil) | |
} | |
catch { | |
print(error.localizedDescription) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment