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

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Saved Image in document directory and save path in coredata not able to fetch the image file iOS swift