Hello!
I'm now working on the simple Dropbox viewer application.
Currently I'm using "download to Documents folder" method like that:
if let data = NSData(contentsOfFile: destinationPath) {
print("File already cached")
} else {
print("File not cached, processing cache operation...")
Manager.client.loadFile(filePath, intoPath: destinationPath)
}
Files are downloading properly, but, I think, that it's a wrong way to cache files.
So, the question is: is there a way to cache images with standard API tools and, for example, store them with NSCache or something similar?
P.S. It's not essentially important, actually, in which programming language will be answer, I'm simply trying to understand the principles, if they exist
Thanks!