class FileManager : NSObject
This extension allows the FileManager to generate a unique directory name.
Creates a temporary directory with a unique name and returns its URL.
You should not rely on the existence of the temporary directory after the app is exited.
func urlForUniqueTemporaryDirectory(preferredName: String? = nil) throws -> (url: URL, deleteDirectory: () throws -> Void)
A tuple of the directory’s URL and a delete function. Call the function to delete the directory after you’re done with it.