-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
51 lines (34 loc) · 1.29 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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.