Authored by Bogdan Poplauschi

Revert "Fixed #774 - remove deprecated methods. Since 4.0 is a major release, we…

… don't need the backwards compatible methods"

This reverts commit 62a8ee1a.
@@ -105,3 +105,20 @@ @@ -105,3 +105,20 @@
105 - (void)sd_cancelCurrentImageLoad; 105 - (void)sd_cancelCurrentImageLoad;
106 106
107 @end 107 @end
  108 +
  109 +
  110 +@interface MKAnnotationView (WebCacheDeprecated)
  111 +
  112 +- (NSURL *)imageURL __deprecated_msg("Use `sd_imageURL`");
  113 +
  114 +- (void)setImageWithURL:(NSURL *)url __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:`");
  115 +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:placeholderImage:`");
  116 +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:placeholderImage:options:`");
  117 +
  118 +- (void)setImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:completed:`");
  119 +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:placeholderImage:completed:`");
  120 +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:placeholderImage:options:completed:`");
  121 +
  122 +- (void)cancelCurrentImageLoad __deprecated_msg("Use `sd_cancelCurrentImageLoad`");
  123 +
  124 +@end
@@ -75,3 +75,52 @@ static char imageURLKey; @@ -75,3 +75,52 @@ static char imageURLKey;
75 } 75 }
76 76
77 @end 77 @end
  78 +
  79 +
  80 +@implementation MKAnnotationView (WebCacheDeprecated)
  81 +
  82 +- (NSURL *)imageURL {
  83 + return [self sd_imageURL];
  84 +}
  85 +
  86 +- (void)setImageWithURL:(NSURL *)url {
  87 + [self sd_setImageWithURL:url placeholderImage:nil options:0 completed:nil];
  88 +}
  89 +
  90 +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder {
  91 + [self sd_setImageWithURL:url placeholderImage:placeholder options:0 completed:nil];
  92 +}
  93 +
  94 +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options {
  95 + [self sd_setImageWithURL:url placeholderImage:placeholder options:options completed:nil];
  96 +}
  97 +
  98 +- (void)setImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock {
  99 + [self sd_setImageWithURL:url placeholderImage:nil options:0 completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
  100 + if (completedBlock) {
  101 + completedBlock(image, error, cacheType);
  102 + }
  103 + }];
  104 +}
  105 +
  106 +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletedBlock)completedBlock {
  107 + [self sd_setImageWithURL:url placeholderImage:placeholder options:0 completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
  108 + if (completedBlock) {
  109 + completedBlock(image, error, cacheType);
  110 + }
  111 + }];
  112 +}
  113 +
  114 +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock {
  115 + [self sd_setImageWithURL:url placeholderImage:placeholder options:options completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
  116 + if (completedBlock) {
  117 + completedBlock(image, error, cacheType);
  118 + }
  119 + }];
  120 +}
  121 +
  122 +- (void)cancelCurrentImageLoad {
  123 + [self sd_cancelCurrentImageLoad];
  124 +}
  125 +
  126 +@end
@@ -17,3 +17,10 @@ @@ -17,3 +17,10 @@
17 + (NSString *)sd_contentTypeForImageData:(NSData *)data; 17 + (NSString *)sd_contentTypeForImageData:(NSData *)data;
18 18
19 @end 19 @end
  20 +
  21 +
  22 +@interface NSData (ImageContentTypeDeprecated)
  23 +
  24 ++ (NSString *)contentTypeForImageData:(NSData *)data __deprecated_msg("Use `sd_contentTypeForImageData:`");
  25 +
  26 +@end
@@ -38,3 +38,12 @@ @@ -38,3 +38,12 @@
38 } 38 }
39 39
40 @end 40 @end
  41 +
  42 +
  43 +@implementation NSData (ImageContentTypeDeprecated)
  44 +
  45 ++ (NSString *)contentTypeForImageData:(NSData *)data {
  46 + return [self sd_contentTypeForImageData:data];
  47 +}
  48 +
  49 +@end
@@ -269,3 +269,24 @@ SDWebImageManager *manager = [SDWebImageManager sharedManager]; @@ -269,3 +269,24 @@ SDWebImageManager *manager = [SDWebImageManager sharedManager];
269 - (NSString *)cacheKeyForURL:(NSURL *)url; 269 - (NSString *)cacheKeyForURL:(NSURL *)url;
270 270
271 @end 271 @end
  272 +
  273 +
  274 +#pragma mark - Deprecated
  275 +
  276 +typedef void(^SDWebImageCompletedBlock)(UIImage *image, NSError *error, SDImageCacheType cacheType) __deprecated_msg("Block type deprecated. Use `SDWebImageCompletionBlock`");
  277 +typedef void(^SDWebImageCompletedWithFinishedBlock)(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished) __deprecated_msg("Block type deprecated. Use `SDWebImageCompletionWithFinishedBlock`");
  278 +
  279 +
  280 +@interface SDWebImageManager (Deprecated)
  281 +
  282 +/**
  283 + * Downloads the image at the given URL if not present in cache or return the cached version otherwise.
  284 + *
  285 + * @deprecated This method has been deprecated. Use `downloadImageWithURL:options:progress:completed:`
  286 + */
  287 +- (id <SDWebImageOperation>)downloadWithURL:(NSURL *)url
  288 + options:(SDWebImageOptions)options
  289 + progress:(SDWebImageDownloaderProgressBlock)progressBlock
  290 + completed:(SDWebImageCompletedWithFinishedBlock)completedBlock __deprecated_msg("Method deprecated. Use `downloadImageWithURL:options:progress:completed:`");
  291 +
  292 +@end
@@ -328,3 +328,21 @@ @@ -328,3 +328,21 @@
328 } 328 }
329 329
330 @end 330 @end
  331 +
  332 +
  333 +@implementation SDWebImageManager (Deprecated)
  334 +
  335 +// deprecated method, uses the non deprecated method
  336 +// adapter for the completion block
  337 +- (id <SDWebImageOperation>)downloadWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedWithFinishedBlock)completedBlock {
  338 + return [self downloadImageWithURL:url
  339 + options:options
  340 + progress:progressBlock
  341 + completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) {
  342 + if (completedBlock) {
  343 + completedBlock(image, error, cacheType, finished);
  344 + }
  345 + }];
  346 +}
  347 +
  348 +@end
@@ -200,3 +200,30 @@ @@ -200,3 +200,30 @@
200 - (void)sd_cancelBackgroundImageLoadForState:(UIControlState)state; 200 - (void)sd_cancelBackgroundImageLoadForState:(UIControlState)state;
201 201
202 @end 202 @end
  203 +
  204 +
  205 +@interface UIButton (WebCacheDeprecated)
  206 +
  207 +- (NSURL *)currentImageURL __deprecated_msg("Use `sd_currentImageURL`");
  208 +- (NSURL *)imageURLForState:(UIControlState)state __deprecated_msg("Use `sd_imageURLForState:`");
  209 +
  210 +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:forState:`");
  211 +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:forState:placeholderImage:`");
  212 +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:forState:placeholderImage:options:`");
  213 +
  214 +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:forState:completed:`");
  215 +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:forState:placeholderImage:completed:`");
  216 +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:forState:placeholderImage:options:completed:`");
  217 +
  218 +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state __deprecated_msg("Method deprecated. Use `sd_setBackgroundImageWithURL:forState:`");
  219 +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder __deprecated_msg("Method deprecated. Use `sd_setBackgroundImageWithURL:forState:placeholderImage:`");
  220 +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options __deprecated_msg("Method deprecated. Use `sd_setBackgroundImageWithURL:forState:placeholderImage:options:`");
  221 +
  222 +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setBackgroundImageWithURL:forState:completed:`");
  223 +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setBackgroundImageWithURL:forState:placeholderImage:completed:`");
  224 +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setBackgroundImageWithURL:forState:placeholderImage:options:completed:`");
  225 +
  226 +- (void)cancelCurrentImageLoad __deprecated_msg("Use `sd_cancelImageLoadForState:`");
  227 +- (void)cancelBackgroundImageLoadForState:(UIControlState)state __deprecated_msg("Use `sd_cancelBackgroundImageLoadForState:`");
  228 +
  229 +@end
@@ -164,3 +164,97 @@ static char imageURLStorageKey; @@ -164,3 +164,97 @@ static char imageURLStorageKey;
164 } 164 }
165 165
166 @end 166 @end
  167 +
  168 +
  169 +@implementation UIButton (WebCacheDeprecated)
  170 +
  171 +- (NSURL *)currentImageURL {
  172 + return [self sd_currentImageURL];
  173 +}
  174 +
  175 +- (NSURL *)imageURLForState:(UIControlState)state {
  176 + return [self sd_imageURLForState:state];
  177 +}
  178 +
  179 +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state {
  180 + [self sd_setImageWithURL:url forState:state placeholderImage:nil options:0 completed:nil];
  181 +}
  182 +
  183 +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder {
  184 + [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:nil];
  185 +}
  186 +
  187 +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options {
  188 + [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:options completed:nil];
  189 +}
  190 +
  191 +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDWebImageCompletedBlock)completedBlock {
  192 + [self sd_setImageWithURL:url forState:state placeholderImage:nil options:0 completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
  193 + if (completedBlock) {
  194 + completedBlock(image, error, cacheType);
  195 + }
  196 + }];
  197 +}
  198 +
  199 +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletedBlock)completedBlock {
  200 + [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
  201 + if (completedBlock) {
  202 + completedBlock(image, error, cacheType);
  203 + }
  204 + }];
  205 +}
  206 +
  207 +- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock {
  208 + [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:options completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
  209 + if (completedBlock) {
  210 + completedBlock(image, error, cacheType);
  211 + }
  212 + }];
  213 +}
  214 +
  215 +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state {
  216 + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:nil options:0 completed:nil];
  217 +}
  218 +
  219 +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder {
  220 + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:nil];
  221 +}
  222 +
  223 +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options {
  224 + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:options completed:nil];
  225 +}
  226 +
  227 +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDWebImageCompletedBlock)completedBlock {
  228 + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:nil options:0 completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
  229 + if (completedBlock) {
  230 + completedBlock(image, error, cacheType);
  231 + }
  232 + }];
  233 +}
  234 +
  235 +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletedBlock)completedBlock {
  236 + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
  237 + if (completedBlock) {
  238 + completedBlock(image, error, cacheType);
  239 + }
  240 + }];
  241 +}
  242 +
  243 +- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock {
  244 + [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:options completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
  245 + if (completedBlock) {
  246 + completedBlock(image, error, cacheType);
  247 + }
  248 + }];
  249 +}
  250 +
  251 +- (void)cancelCurrentImageLoad {
  252 + // in a backwards compatible manner, cancel for current state
  253 + [self sd_cancelImageLoadForState:self.state];
  254 +}
  255 +
  256 +- (void)cancelBackgroundImageLoadForState:(UIControlState)state {
  257 + [self sd_cancelBackgroundImageLoadForState:state];
  258 +}
  259 +
  260 +@end
@@ -85,3 +85,16 @@ @@ -85,3 +85,16 @@
85 - (void)sd_cancelCurrentHighlightedImageLoad; 85 - (void)sd_cancelCurrentHighlightedImageLoad;
86 86
87 @end 87 @end
  88 +
  89 +
  90 +@interface UIImageView (HighlightedWebCacheDeprecated)
  91 +
  92 +- (void)setHighlightedImageWithURL:(NSURL *)url __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:`");
  93 +- (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:`");
  94 +- (void)setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:completed:`");
  95 +- (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:completed:`");
  96 +- (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:progress:completed:`");
  97 +
  98 +- (void)cancelCurrentHighlightedImageLoad __deprecated_msg("Use `sd_cancelCurrentHighlightedImageLoad`");
  99 +
  100 +@end
@@ -64,3 +64,44 @@ @@ -64,3 +64,44 @@
64 } 64 }
65 65
66 @end 66 @end
  67 +
  68 +
  69 +@implementation UIImageView (HighlightedWebCacheDeprecated)
  70 +
  71 +- (void)setHighlightedImageWithURL:(NSURL *)url {
  72 + [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:nil];
  73 +}
  74 +
  75 +- (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options {
  76 + [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil];
  77 +}
  78 +
  79 +- (void)setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock {
  80 + [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
  81 + if (completedBlock) {
  82 + completedBlock(image, error, cacheType);
  83 + }
  84 + }];
  85 +}
  86 +
  87 +- (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock {
  88 + [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
  89 + if (completedBlock) {
  90 + completedBlock(image, error, cacheType);
  91 + }
  92 + }];
  93 +}
  94 +
  95 +- (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock {
  96 + [self sd_setHighlightedImageWithURL:url options:0 progress:progressBlock completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
  97 + if (completedBlock) {
  98 + completedBlock(image, error, cacheType);
  99 + }
  100 + }];
  101 +}
  102 +
  103 +- (void)cancelCurrentHighlightedImageLoad {
  104 + [self sd_cancelCurrentHighlightedImageLoad];
  105 +}
  106 +
  107 +@end
@@ -177,3 +177,25 @@ @@ -177,3 +177,25 @@
177 - (void)sd_cancelCurrentAnimationImagesLoad; 177 - (void)sd_cancelCurrentAnimationImagesLoad;
178 178
179 @end 179 @end
  180 +
  181 +
  182 +@interface UIImageView (WebCacheDeprecated)
  183 +
  184 +- (NSURL *)imageURL __deprecated_msg("Use `sd_imageURL`");
  185 +
  186 +- (void)setImageWithURL:(NSURL *)url __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:`");
  187 +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:placeholderImage:`");
  188 +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:placeholderImage:options`");
  189 +
  190 +- (void)setImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:completed:`");
  191 +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:placeholderImage:completed:`");
  192 +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:placeholderImage:options:completed:`");
  193 +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:placeholderImage:options:progress:completed:`");
  194 +
  195 +- (void)setAnimationImagesWithURLs:(NSArray *)arrayOfURLs __deprecated_msg("Use `sd_setAnimationImagesWithURLs:`");
  196 +
  197 +- (void)cancelCurrentArrayLoad __deprecated_msg("Use `sd_cancelCurrentAnimationImagesLoad`");
  198 +
  199 +- (void)cancelCurrentImageLoad __deprecated_msg("Use `sd_cancelCurrentImageLoad`");
  200 +
  201 +@end
@@ -130,3 +130,68 @@ static char imageURLKey; @@ -130,3 +130,68 @@ static char imageURLKey;
130 } 130 }
131 131
132 @end 132 @end
  133 +
  134 +
  135 +@implementation UIImageView (WebCacheDeprecated)
  136 +
  137 +- (NSURL *)imageURL {
  138 + return [self sd_imageURL];
  139 +}
  140 +
  141 +- (void)setImageWithURL:(NSURL *)url {
  142 + [self sd_setImageWithURL:url placeholderImage:nil options:0 progress:nil completed:nil];
  143 +}
  144 +
  145 +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder {
  146 + [self sd_setImageWithURL:url placeholderImage:placeholder options:0 progress:nil completed:nil];
  147 +}
  148 +
  149 +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options {
  150 + [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:nil];
  151 +}
  152 +
  153 +- (void)setImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock {
  154 + [self sd_setImageWithURL:url placeholderImage:nil options:0 progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
  155 + if (completedBlock) {
  156 + completedBlock(image, error, cacheType);
  157 + }
  158 + }];
  159 +}
  160 +
  161 +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletedBlock)completedBlock {
  162 + [self sd_setImageWithURL:url placeholderImage:placeholder options:0 progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
  163 + if (completedBlock) {
  164 + completedBlock(image, error, cacheType);
  165 + }
  166 + }];
  167 +}
  168 +
  169 +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock {
  170 + [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
  171 + if (completedBlock) {
  172 + completedBlock(image, error, cacheType);
  173 + }
  174 + }];
  175 +}
  176 +
  177 +- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock {
  178 + [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:progressBlock completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
  179 + if (completedBlock) {
  180 + completedBlock(image, error, cacheType);
  181 + }
  182 + }];
  183 +}
  184 +
  185 +- (void)cancelCurrentArrayLoad {
  186 + [self sd_cancelCurrentAnimationImagesLoad];
  187 +}
  188 +
  189 +- (void)cancelCurrentImageLoad {
  190 + [self sd_cancelCurrentImageLoad];
  191 +}
  192 +
  193 +- (void)setAnimationImagesWithURLs:(NSArray *)arrayOfURLs {
  194 + [self sd_setAnimationImagesWithURLs:arrayOfURLs];
  195 +}
  196 +
  197 +@end