@@ -58,25 +58,25 @@ it, et voila!
58
58
How To Use It
59
59
-------------
60
60
61
- ### DMWebImageView as UIImageWeb Drop-In Replacement
61
+ ### SDWebImageView as UIImageWeb Drop-In Replacement
62
62
63
63
Most common use is in conjunction with an UITableView:
64
64
65
65
- Place an UIImageView as a subview of your UITableViewCell in Interface Builder
66
- - Set its class to DMImageView in the identity panel.
66
+ - Set its class to SDImageView in the identity panel.
67
67
- Optionally set an image from your bundle to this UIImageView, it will be used as a placeholder
68
68
image waiting for the real image to be downloaded.
69
69
- In your tableView:cellForRowAtIndexPath: UITableViewDataSource method, invoke the setImageWithURL:
70
- method of the DMWebImage view with the URL of the image to download
70
+ method of the SDWebImage view with the URL of the image to download
71
71
72
72
Your done, everything will be handled for you, from parallel downloads to caching management.
73
73
74
74
### Asynchronous Image Downloader
75
75
76
76
It is possible to use the NSOperation based image downloader independently. Just create an instance
77
- of DMWebImageDownloader using its convenience constructor downloaderWithURL:target:action:.
77
+ of SDWebImageDownloader using its convenience constructor downloaderWithURL:target:action:.
78
78
79
- downloader = [DMWebImageDownloader downloaderWithURL:url
79
+ downloader = [SDWebImageDownloader downloaderWithURL:url
80
80
target:self
81
81
action:@selector(downloadFinishedWithImage:)];
82
82
@@ -85,27 +85,27 @@ soon as the download of image will be completed (prepare not to be called from t
85
85
86
86
### Asynchronous Image Caching
87
87
88
- It is also possible to use the NSOperation based image cache store independently. DMImageCache
88
+ It is also possible to use the NSOperation based image cache store independently. SDImageCache
89
89
maintains a memory cache and an optional disk cache. Disk cache write operations are performed
90
90
asynchronous so it doesn't add unnecessary latency to the UI.
91
91
92
- The DMImageCache class provides a singleton instance for convenience but you can create your own
92
+ The SDImageCache class provides a singleton instance for convenience but you can create your own
93
93
instance if you want to create separated cache namespaces.
94
94
95
95
To lookup the cache, you use the imageForKey: method. If the method returns nil, it means the cache
96
96
doesn't currently own the image. You are thus responsible of generating and caching it. The cache
97
97
key is an application unique identifier for the image to cache. It is generally the absolute URL of
98
98
the image.
99
99
100
- UIImage *myCachedImage = [[DMImageCache sharedImageCache] imageFromKey:myCacheKey];
100
+ UIImage *myCachedImage = [[SDImageCache sharedImageCache] imageFromKey:myCacheKey];
101
101
102
- By default DMImageCache will lookup the disk cache if an image can't be found in the memory cache.
102
+ By default SDImageCache will lookup the disk cache if an image can't be found in the memory cache.
103
103
You can prevent this from happening by calling the alternative method imageFromKey:fromDisk: with a
104
104
negative second argument.
105
105
106
106
To store an image into the cache, you use the storeImage:forKey: method:
107
107
108
- [[DMImageCache sharedImageCache] storeImage:myImage forKey:myCacheKey];
108
+ [[SDImageCache sharedImageCache] storeImage:myImage forKey:myCacheKey];
109
109
110
110
By default, the image will be stored in memory cache as well as on disk cache (asynchronously). If
111
111
you want only the memory cache, use the alternative method storeImage:forKey:toDisk: with a negative
0 commit comments