How to create temp directory for my app iOS swift?
Solution:
func directoryCreation() {
let fileManager = FileManager.default
//for tempFolder
let tempPath = documentsDirGroupPath.appendingFormat("/Temp") // My folder name in document directory
let tempSuccess = fileManager.fileExists(atPath: tempPath) as Bool
if tempSuccess == false {
do {
try! fileManager.createDirectory(atPath: tempPath, withIntermediateDirectories: true, attributes: nil)
}
}
}
Comments
Post a Comment