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

Convert NsNumber, NSDate to String in iOS Swift

Global LocationManager Singleton class iOS Swift