Answers for "swift temporary directory"

1

swift temporary directory

func createTempDirectory() -> String? {
    let tempDirectoryTemplate = NSTemporaryDirectory().stringByAppendingPathComponent("XXXXX")

    let fileManager = NSFileManager.defaultManager()

    var err: NSErrorPointer = nil
    if fileManager.createDirectoryAtPath(tempDirectoryTemplate, withIntermediateDirectories: true, attributes: nil, error: err) {
        return tempDirectoryTemplate
    } else {
        return nil
    }
}
Posted by: Guest on March-13-2020

Code answers related to "swift temporary directory"

Code answers related to "Swift"

Browse Popular Code Answers by Language