Skip to content

mikerhodes/MRScalingImageCache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 

Repository files navigation

MRScalingImageCache
===================

A helpful image cache for iOS.

Downloads and stores images from URLs. Allows you to define
named "scales" for different image sizes required by your
app. You can then ask the cache for an image for a given
URL and scale. The cache will create the size if needed,
store it in the cache, and return the sized version. The
next time you want the same scale, it's right there.

This class was originally created to cache thumbnail
images for use in a scrolling list view in my app
One to Watch. Pre-scaling was essential for scrolling
performance; resizing each time a row was displayed
wasn't cutting it.

The class allows cleanup by providing a list of URLs to
keep -- all other cached images are discarded.


Limitations
===========

The code is currently hardcoded to fit the scaled image
into a box as Aspect Fill. This is one of the first 
opportunities for improvement.

Oh, and tests.

It's written for ARC, which requires XCode 4.2.

You can enable ARC for single files using the -fobjc-arc
compiler flag in Target -> Build Phases -> Compile Sources.


Requires
========

AFNetworking
- https://github.com/AFNetworking/AFNetworking/

UIImage Extensions from:
- http://vocaro.com/trevor/blog/2009/10/12/resize-a-uiimage-the-right-way/


Licence
=======

See individual code files.

About

A helpful image cache for iOS.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published