An iOS cache category

Inspired by, and built on top of, the excellent work earlier today by Vinny Coyne on UIImage caching I have released my first bit of code to the public domain. It is a category that checks if a specified file exists in the cache directory.

You can find my code here on GitHub

I implemented Vinny’s category for some images in my next app today but I needed a little bit more than this. In my particular instance I want to display a default Logo in the masthead but override this with a downloaded image only if that image is available.

Why? My next app allows the user to choose which football team they support and the interface is then “skinned” in that team’s colours. It is preferable to me that these skins be downloaded as required rather than have to include images for every team in the app package.

This category is very basic but hopefully someone may find it useful, and if you have any comments I would love to hear them.