daltoniam/Skeets

Proposed Cache path in documentation

a7ex opened this issue · 1 comments

a7ex commented

In the documentation of Skeets one example shows how to specify the cache path.

//set the cache directory. Only have to do this once since `sharedManager` is a singleton
let paths = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)
ImageManager.sharedManager.cache.diskDirectory = "\(paths[0])/ImageCache"

My understanding until now was, that the Document Directory (and its subdirectories) is NOT the right choice to store cache data, it even leads to failing the app review process, due to the fact, that the Document Directory gets backed up to the iCloud and cache data is nothing, which we really want to back up in the cloud.

Unless of course we exclude the Directory, which we specified, from the iCloud backup explicitly.

I thought the NSSearchPathDirectory.CachesDirectory would be the appropriate location to store cache data?

Agreed, the documentation should probably be updated. That isn't an ideal example, was just something I used for testing and forgot to change. I just updated it to use the CachesDirectory. Thanks!