Skip to content

Commit a7734af

Browse files
author
Olivier Poitrey
committed
Remove Dailymotion paternity and move to joined paternity with Fraggle behind the Simple Design (SD) team name
1 parent 8370d5d commit a7734af

8 files changed

+44
-44
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2009 Dailymotion - Olivier Poitrey <[email protected]>
1+
Copyright (c) 2009 Olivier Poitrey <[email protected]>
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -58,25 +58,25 @@ it, et voila!
5858
How To Use It
5959
-------------
6060

61-
### DMWebImageView as UIImageWeb Drop-In Replacement
61+
### SDWebImageView as UIImageWeb Drop-In Replacement
6262

6363
Most common use is in conjunction with an UITableView:
6464

6565
- 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.
6767
- Optionally set an image from your bundle to this UIImageView, it will be used as a placeholder
6868
image waiting for the real image to be downloaded.
6969
- 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
7171

7272
Your done, everything will be handled for you, from parallel downloads to caching management.
7373

7474
### Asynchronous Image Downloader
7575

7676
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:.
7878

79-
downloader = [DMWebImageDownloader downloaderWithURL:url
79+
downloader = [SDWebImageDownloader downloaderWithURL:url
8080
target:self
8181
action:@selector(downloadFinishedWithImage:)];
8282

@@ -85,27 +85,27 @@ soon as the download of image will be completed (prepare not to be called from t
8585

8686
### Asynchronous Image Caching
8787

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
8989
maintains a memory cache and an optional disk cache. Disk cache write operations are performed
9090
asynchronous so it doesn't add unnecessary latency to the UI.
9191

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
9393
instance if you want to create separated cache namespaces.
9494

9595
To lookup the cache, you use the imageForKey: method. If the method returns nil, it means the cache
9696
doesn't currently own the image. You are thus responsible of generating and caching it. The cache
9797
key is an application unique identifier for the image to cache. It is generally the absolute URL of
9898
the image.
9999

100-
UIImage *myCachedImage = [[DMImageCache sharedImageCache] imageFromKey:myCacheKey];
100+
UIImage *myCachedImage = [[SDImageCache sharedImageCache] imageFromKey:myCacheKey];
101101

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.
103103
You can prevent this from happening by calling the alternative method imageFromKey:fromDisk: with a
104104
negative second argument.
105105

106106
To store an image into the cache, you use the storeImage:forKey: method:
107107

108-
[[DMImageCache sharedImageCache] storeImage:myImage forKey:myCacheKey];
108+
[[SDImageCache sharedImageCache] storeImage:myImage forKey:myCacheKey];
109109

110110
By default, the image will be stored in memory cache as well as on disk cache (asynchronously). If
111111
you want only the memory cache, use the alternative method storeImage:forKey:toDisk: with a negative

DMImageCache.h SDImageCache.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
/*
2-
* This file is part of the DMWebImage package.
3-
* (c) Dailymotion - Olivier Poitrey <[email protected]>
2+
* This file is part of the SDWebImage package.
3+
* (c) Olivier Poitrey <[email protected]>
44
*
55
* For the full copyright and license information, please view the LICENSE
66
* file that was distributed with this source code.
77
*/
88

99
#import <Foundation/Foundation.h>
1010

11-
@interface DMImageCache : NSObject
11+
@interface SDImageCache : NSObject
1212
{
1313
NSMutableDictionary *memCache;
1414
NSString *diskCachePath;
1515
NSOperationQueue *cacheInQueue;
1616
}
1717

18-
+ (DMImageCache *)sharedImageCache;
18+
+ (SDImageCache *)sharedImageCache;
1919
- (void)storeImage:(UIImage *)image forKey:(NSString *)key;
2020
- (void)storeImage:(UIImage *)image forKey:(NSString *)key toDisk:(BOOL)toDisk;
2121
- (UIImage *)imageFromKey:(NSString *)key;

DMImageCache.m SDImageCache.m

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
/*
2-
* This file is part of the DMWebImage package.
3-
* (c) Dailymotion - Olivier Poitrey <[email protected]>
2+
* This file is part of the SDWebImage package.
3+
* (c) Olivier Poitrey <[email protected]>
44
*
55
* For the full copyright and license information, please view the LICENSE
66
* file that was distributed with this source code.
77
*/
88

9-
#import "DMImageCache.h"
9+
#import "SDImageCache.h"
1010
#import <CommonCrypto/CommonDigest.h>
1111

1212
static NSInteger cacheMaxCacheAge = 60*60*24*7; // 1 week
1313

14-
static DMImageCache *instance;
14+
static SDImageCache *instance;
1515

16-
@implementation DMImageCache
16+
@implementation SDImageCache
1717

1818
#pragma mark NSObject
1919

@@ -81,11 +81,11 @@ - (void)willTerminate
8181

8282
#pragma mark ImageCache (class methods)
8383

84-
+ (DMImageCache *)sharedImageCache
84+
+ (SDImageCache *)sharedImageCache
8585
{
8686
if (instance == nil)
8787
{
88-
instance = [[DMImageCache alloc] init];
88+
instance = [[SDImageCache alloc] init];
8989
}
9090

9191
return instance;

DMWebImageDownloader.h SDWebImageDownloader.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/*
2-
* This file is part of the DMWebImage package.
3-
* (c) Dailymotion - Olivier Poitrey <[email protected]>
2+
* This file is part of the SDWebImage package.
3+
* (c) Olivier Poitrey <[email protected]>
44
*
55
* For the full copyright and license information, please view the LICENSE
66
* file that was distributed with this source code.
77
*/
88

99
#import <Foundation/Foundation.h>
1010

11-
@interface DMWebImageDownloader : NSOperation
11+
@interface SDWebImageDownloader : NSOperation
1212
{
1313
NSURL *url;
1414
id target;

DMWebImageDownloader.m SDWebImageDownloader.m

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
/*
2-
* This file is part of the DMWebImage package.
3-
* (c) Dailymotion - Olivier Poitrey <[email protected]>
2+
* This file is part of the SDWebImage package.
3+
* (c) Olivier Poitrey <[email protected]>
44
*
55
* For the full copyright and license information, please view the LICENSE
66
* file that was distributed with this source code.
77
*/
88

9-
#import "DMWebImageDownloader.h"
9+
#import "SDWebImageDownloader.h"
1010

1111
static NSOperationQueue *downloadQueue;
1212

13-
@implementation DMWebImageDownloader
13+
@implementation SDWebImageDownloader
1414

1515
@synthesize url, target, action;
1616

@@ -22,7 +22,7 @@ - (void)dealloc
2222

2323
+ (id)downloaderWithURL:(NSURL *)url target:(id)target action:(SEL)action
2424
{
25-
DMWebImageDownloader *downloader = [[[DMWebImageDownloader alloc] init] autorelease];
25+
SDWebImageDownloader *downloader = [[[SDWebImageDownloader alloc] init] autorelease];
2626
downloader.url = url;
2727
downloader.target = target;
2828
downloader.action = action;

DMWebImageView.h SDWebImageView.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
/*
2-
* This file is part of the DMWebImage package.
3-
* (c) Dailymotion - Olivier Poitrey <[email protected]>
2+
* This file is part of the SDWebImage package.
3+
* (c) Olivier Poitrey <[email protected]>
44
*
55
* For the full copyright and license information, please view the LICENSE
66
* file that was distributed with this source code.
77
*/
88

99
#import <UIKit/UIKit.h>
1010

11-
@class DMWebImageDownloader;
11+
@class SDWebImageDownloader;
1212

13-
@interface DMWebImageView : UIImageView
13+
@interface SDWebImageView : UIImageView
1414
{
1515
UIImage *placeHolderImage;
16-
DMWebImageDownloader *downloader;
16+
SDWebImageDownloader *downloader;
1717
}
1818

1919
- (void)setImageWithURL:(NSURL *)url;

DMWebImageView.m SDWebImageView.m

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
/*
2-
* This file is part of the DMWebImage package.
3-
* (c) Dailymotion - Olivier Poitrey <[email protected]>
2+
* This file is part of the SDWebImage package.
3+
* (c) Olivier Poitrey <[email protected]>
44
*
55
* For the full copyright and license information, please view the LICENSE
66
* file that was distributed with this source code.
77
*/
88

9-
#import "DMWebImageView.h"
10-
#import "DMImageCache.h"
11-
#import "DMWebImageDownloader.h"
9+
#import "SDWebImageView.h"
10+
#import "SDImageCache.h"
11+
#import "SDWebImageDownloader.h"
1212

13-
@implementation DMWebImageView
13+
@implementation SDWebImageView
1414

1515
- (void)dealloc
1616
{
@@ -41,15 +41,15 @@ - (void)setImageWithURL:(NSURL *)url
4141
self.image = placeHolderImage;
4242
}
4343

44-
UIImage *cachedImage = [[DMImageCache sharedImageCache] imageFromKey:[url absoluteString]];
44+
UIImage *cachedImage = [[SDImageCache sharedImageCache] imageFromKey:[url absoluteString]];
4545

4646
if (cachedImage)
4747
{
4848
self.image = cachedImage;
4949
}
5050
else
5151
{
52-
downloader = [[DMWebImageDownloader downloaderWithURL:url target:self action:@selector(downloadFinishedWithImage:)] retain];
52+
downloader = [[SDWebImageDownloader downloaderWithURL:url target:self action:@selector(downloadFinishedWithImage:)] retain];
5353
}
5454
}
5555

@@ -59,7 +59,7 @@ - (void)downloadFinishedWithImage:(UIImage *)anImage
5959
self.image = anImage;
6060

6161
// Store the image in the cache
62-
[[DMImageCache sharedImageCache] storeImage:anImage forKey:[downloader.url absoluteString]];
62+
[[SDImageCache sharedImageCache] storeImage:anImage forKey:[downloader.url absoluteString]];
6363

6464
// Free the downloader
6565
[downloader release];

0 commit comments

Comments
 (0)