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

store cgpoint in userdefaults iOS swift