OLImageView icon indicating copy to clipboard operation
OLImageView copied to clipboard

Cache imageNamed

Open dtorres opened this issue 12 years ago • 1 comments

The current implementation of UIImage caches the instances created by this method. And GIFs are really expensive to create. So, why not?

dtorres avatar Apr 27 '13 18:04 dtorres

I'm not entirely sure... the implications of caching GIFs are more significant than just caching images because of their potential size. At the very least, one needs to be able to turn caching off.

I implement a simple NSCache for the reusable GIFs I add to OLImageViews as a property of my view controller. Doing the same thing by default would mean adding a singleton to the OL classes unless you wanted to make a OLImageCache class... then do a setCacheObject: for each OLImage object you have? Seems like that route is as no less work than making your own NSCache.

nickoneill avatar Apr 27 '13 19:04 nickoneill