I\'m trying to create a new folder, but I can\'t figure out how to use createDirectoryAtPath correctly.
According to the documentation, this is the correct syntax:>
Based on seb's code above. When I used this in my function I had to add a generic catch too. This removed the "Errors thrown from here are not handled because the enclosing catch is not exhaustive" error.
do {
var deliverablePathString = "/tmp/asdf"
try NSFileManager.defaultManager().createDirectoryAtPath(deliverablePathString, withIntermediateDirectories: false, attributes: nil)
} catch let error as NSError {
NSLog("\(error.localizedDescription)")
} catch {
print("general error - \(error)", appendNewline: true)
}