For consistency with the previous change, also renamed `SDWebImageCompletionBlock` to `SDExternalCompletionBlock`

This commit is contained in:
Bogdan Poplauschi 2016-06-01 09:41:44 +03:00
parent aecb13d421
commit 8f4a9dae2d
9 changed files with 35 additions and 35 deletions

View File

@ -66,7 +66,7 @@
* indicating if the image was retrieved from the local cache or from the network. * indicating if the image was retrieved from the local cache or from the network.
* The fourth parameter is the original image url. * The fourth parameter is the original image url.
*/ */
- (void)sd_setImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock; - (void)sd_setImageWithURL:(NSURL *)url completed:(SDExternalCompletionBlock)completedBlock;
/** /**
* Set the imageView `image` with an `url`, placeholder. * Set the imageView `image` with an `url`, placeholder.
@ -81,7 +81,7 @@
* indicating if the image was retrieved from the local cache or from the network. * indicating if the image was retrieved from the local cache or from the network.
* The fourth parameter is the original image url. * The fourth parameter is the original image url.
*/ */
- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletionBlock)completedBlock; - (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(SDExternalCompletionBlock)completedBlock;
/** /**
* Set the imageView `image` with an `url`, placeholder and custom options. * Set the imageView `image` with an `url`, placeholder and custom options.
@ -97,7 +97,7 @@
* indicating if the image was retrieved from the local cache or from the network. * indicating if the image was retrieved from the local cache or from the network.
* The fourth parameter is the original image url. * The fourth parameter is the original image url.
*/ */
- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock; - (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDExternalCompletionBlock)completedBlock;
/** /**
* Cancel the current download * Cancel the current download

View File

@ -30,15 +30,15 @@ static char imageURLKey;
[self sd_setImageWithURL:url placeholderImage:placeholder options:options completed:nil]; [self sd_setImageWithURL:url placeholderImage:placeholder options:options completed:nil];
} }
- (void)sd_setImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock { - (void)sd_setImageWithURL:(NSURL *)url completed:(SDExternalCompletionBlock)completedBlock {
[self sd_setImageWithURL:url placeholderImage:nil options:0 completed:completedBlock]; [self sd_setImageWithURL:url placeholderImage:nil options:0 completed:completedBlock];
} }
- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletionBlock)completedBlock { - (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(SDExternalCompletionBlock)completedBlock {
[self sd_setImageWithURL:url placeholderImage:placeholder options:0 completed:completedBlock]; [self sd_setImageWithURL:url placeholderImage:placeholder options:0 completed:completedBlock];
} }
- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock { - (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDExternalCompletionBlock)completedBlock {
[self sd_cancelCurrentImageLoad]; [self sd_cancelCurrentImageLoad];
objc_setAssociatedObject(self, &imageURLKey, url, OBJC_ASSOCIATION_RETAIN_NONATOMIC); objc_setAssociatedObject(self, &imageURLKey, url, OBJC_ASSOCIATION_RETAIN_NONATOMIC);

View File

@ -90,7 +90,7 @@ typedef NS_OPTIONS(NSUInteger, SDWebImageOptions) {
SDWebImageAvoidAutoSetImage = 1 << 11 SDWebImageAvoidAutoSetImage = 1 << 11
}; };
typedef void(^SDWebImageCompletionBlock)(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL); typedef void(^SDExternalCompletionBlock)(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL);
typedef void(^SDInternalCompletionBlock)(UIImage *image, NSData *data, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL); typedef void(^SDInternalCompletionBlock)(UIImage *image, NSData *data, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL);

View File

@ -73,7 +73,7 @@
* indicating if the image was retrieved from the local cache or from the network. * indicating if the image was retrieved from the local cache or from the network.
* The fourth parameter is the original image url. * The fourth parameter is the original image url.
*/ */
- (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDWebImageCompletionBlock)completedBlock; - (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDExternalCompletionBlock)completedBlock;
/** /**
* Set the imageView `image` with an `url`, placeholder. * Set the imageView `image` with an `url`, placeholder.
@ -89,7 +89,7 @@
* indicating if the image was retrieved from the local cache or from the network. * indicating if the image was retrieved from the local cache or from the network.
* The fourth parameter is the original image url. * The fourth parameter is the original image url.
*/ */
- (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletionBlock)completedBlock; - (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDExternalCompletionBlock)completedBlock;
/** /**
* Set the imageView `image` with an `url`, placeholder and custom options. * Set the imageView `image` with an `url`, placeholder and custom options.
@ -106,7 +106,7 @@
* indicating if the image was retrieved from the local cache or from the network. * indicating if the image was retrieved from the local cache or from the network.
* The fourth parameter is the original image url. * The fourth parameter is the original image url.
*/ */
- (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock; - (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDExternalCompletionBlock)completedBlock;
/** /**
* Set the backgroundImageView `image` with an `url`. * Set the backgroundImageView `image` with an `url`.
@ -155,7 +155,7 @@
* indicating if the image was retrieved from the local cache or from the network. * indicating if the image was retrieved from the local cache or from the network.
* The fourth parameter is the original image url. * The fourth parameter is the original image url.
*/ */
- (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDWebImageCompletionBlock)completedBlock; - (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDExternalCompletionBlock)completedBlock;
/** /**
* Set the backgroundImageView `image` with an `url`, placeholder. * Set the backgroundImageView `image` with an `url`, placeholder.
@ -171,7 +171,7 @@
* indicating if the image was retrieved from the local cache or from the network. * indicating if the image was retrieved from the local cache or from the network.
* The fourth parameter is the original image url. * The fourth parameter is the original image url.
*/ */
- (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletionBlock)completedBlock; - (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDExternalCompletionBlock)completedBlock;
/** /**
* Set the backgroundImageView `image` with an `url`, placeholder and custom options. * Set the backgroundImageView `image` with an `url`, placeholder and custom options.
@ -187,7 +187,7 @@
* indicating if the image was retrieved from the local cache or from the network. * indicating if the image was retrieved from the local cache or from the network.
* The fourth parameter is the original image url. * The fourth parameter is the original image url.
*/ */
- (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock; - (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDExternalCompletionBlock)completedBlock;
/** /**
* Cancel the current image download * Cancel the current image download

View File

@ -40,15 +40,15 @@ static char imageURLStorageKey;
[self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:options completed:nil]; [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:options completed:nil];
} }
- (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDWebImageCompletionBlock)completedBlock { - (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDExternalCompletionBlock)completedBlock {
[self sd_setImageWithURL:url forState:state placeholderImage:nil options:0 completed:completedBlock]; [self sd_setImageWithURL:url forState:state placeholderImage:nil options:0 completed:completedBlock];
} }
- (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletionBlock)completedBlock { - (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDExternalCompletionBlock)completedBlock {
[self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:completedBlock]; [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:completedBlock];
} }
- (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock { - (void)sd_setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDExternalCompletionBlock)completedBlock {
[self setImage:placeholder forState:state]; [self setImage:placeholder forState:state];
[self sd_cancelImageLoadForState:state]; [self sd_cancelImageLoadForState:state];
@ -102,15 +102,15 @@ static char imageURLStorageKey;
[self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:options completed:nil]; [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:options completed:nil];
} }
- (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDWebImageCompletionBlock)completedBlock { - (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDExternalCompletionBlock)completedBlock {
[self sd_setBackgroundImageWithURL:url forState:state placeholderImage:nil options:0 completed:completedBlock]; [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:nil options:0 completed:completedBlock];
} }
- (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletionBlock)completedBlock { - (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDExternalCompletionBlock)completedBlock {
[self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:completedBlock]; [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:completedBlock];
} }
- (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock { - (void)sd_setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDExternalCompletionBlock)completedBlock {
[self sd_cancelBackgroundImageLoadForState:state]; [self sd_cancelBackgroundImageLoadForState:state];
[self setBackgroundImage:placeholder forState:state]; [self setBackgroundImage:placeholder forState:state];

View File

@ -46,7 +46,7 @@
* indicating if the image was retrieved from the local cache or from the network. * indicating if the image was retrieved from the local cache or from the network.
* The fourth parameter is the original image url. * The fourth parameter is the original image url.
*/ */
- (void)sd_setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock; - (void)sd_setHighlightedImageWithURL:(NSURL *)url completed:(SDExternalCompletionBlock)completedBlock;
/** /**
* Set the imageView `highlightedImage` with an `url` and custom options. * Set the imageView `highlightedImage` with an `url` and custom options.
@ -61,7 +61,7 @@
* indicating if the image was retrieved from the local cache or from the network. * indicating if the image was retrieved from the local cache or from the network.
* The fourth parameter is the original image url. * The fourth parameter is the original image url.
*/ */
- (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock; - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDExternalCompletionBlock)completedBlock;
/** /**
* Set the imageView `highlightedImage` with an `url` and custom options. * Set the imageView `highlightedImage` with an `url` and custom options.
@ -77,7 +77,7 @@
* indicating if the image was retrieved from the local cache or from the network. * indicating if the image was retrieved from the local cache or from the network.
* The fourth parameter is the original image url. * The fourth parameter is the original image url.
*/ */
- (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock; - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDExternalCompletionBlock)completedBlock;
/** /**
* Cancel the current download * Cancel the current download

View File

@ -21,15 +21,15 @@
[self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil]; [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil];
} }
- (void)sd_setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock { - (void)sd_setHighlightedImageWithURL:(NSURL *)url completed:(SDExternalCompletionBlock)completedBlock {
[self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:completedBlock]; [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:completedBlock];
} }
- (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock { - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDExternalCompletionBlock)completedBlock {
[self sd_setHighlightedImageWithURL:url options:options progress:nil completed:completedBlock]; [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:completedBlock];
} }
- (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock { - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDExternalCompletionBlock)completedBlock {
[self sd_cancelCurrentHighlightedImageLoad]; [self sd_cancelCurrentHighlightedImageLoad];
if (url) { if (url) {

View File

@ -95,7 +95,7 @@
* indicating if the image was retrieved from the local cache or from the network. * indicating if the image was retrieved from the local cache or from the network.
* The fourth parameter is the original image url. * The fourth parameter is the original image url.
*/ */
- (void)sd_setImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock; - (void)sd_setImageWithURL:(NSURL *)url completed:(SDExternalCompletionBlock)completedBlock;
/** /**
* Set the imageView `image` with an `url`, placeholder. * Set the imageView `image` with an `url`, placeholder.
@ -110,7 +110,7 @@
* indicating if the image was retrieved from the local cache or from the network. * indicating if the image was retrieved from the local cache or from the network.
* The fourth parameter is the original image url. * The fourth parameter is the original image url.
*/ */
- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletionBlock)completedBlock; - (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(SDExternalCompletionBlock)completedBlock;
/** /**
* Set the imageView `image` with an `url`, placeholder and custom options. * Set the imageView `image` with an `url`, placeholder and custom options.
@ -126,7 +126,7 @@
* indicating if the image was retrieved from the local cache or from the network. * indicating if the image was retrieved from the local cache or from the network.
* The fourth parameter is the original image url. * The fourth parameter is the original image url.
*/ */
- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock; - (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDExternalCompletionBlock)completedBlock;
/** /**
* Set the imageView `image` with an `url`, placeholder and custom options. * Set the imageView `image` with an `url`, placeholder and custom options.
@ -143,7 +143,7 @@
* indicating if the image was retrieved from the local cache or from the network. * indicating if the image was retrieved from the local cache or from the network.
* The fourth parameter is the original image url. * The fourth parameter is the original image url.
*/ */
- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock; - (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDExternalCompletionBlock)completedBlock;
/** /**
* Set the imageView `image` with an `url` and optionally a placeholder image. * Set the imageView `image` with an `url` and optionally a placeholder image.
@ -160,7 +160,7 @@
* indicating if the image was retrieved from the local cache or from the network. * indicating if the image was retrieved from the local cache or from the network.
* The fourth parameter is the original image url. * The fourth parameter is the original image url.
*/ */
- (void)sd_setImageWithPreviousCachedImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock; - (void)sd_setImageWithPreviousCachedImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDExternalCompletionBlock)completedBlock;
/** /**
* Download an array of images and starts them in an animation loop * Download an array of images and starts them in an animation loop

View File

@ -29,19 +29,19 @@ static char TAG_ACTIVITY_SHOW;
[self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:nil]; [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:nil];
} }
- (void)sd_setImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock { - (void)sd_setImageWithURL:(NSURL *)url completed:(SDExternalCompletionBlock)completedBlock {
[self sd_setImageWithURL:url placeholderImage:nil options:0 progress:nil completed:completedBlock]; [self sd_setImageWithURL:url placeholderImage:nil options:0 progress:nil completed:completedBlock];
} }
- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletionBlock)completedBlock { - (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(SDExternalCompletionBlock)completedBlock {
[self sd_setImageWithURL:url placeholderImage:placeholder options:0 progress:nil completed:completedBlock]; [self sd_setImageWithURL:url placeholderImage:placeholder options:0 progress:nil completed:completedBlock];
} }
- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock { - (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDExternalCompletionBlock)completedBlock {
[self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:completedBlock]; [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:completedBlock];
} }
- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock { - (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDExternalCompletionBlock)completedBlock {
[self sd_cancelCurrentImageLoad]; [self sd_cancelCurrentImageLoad];
objc_setAssociatedObject(self, &imageURLKey, url, OBJC_ASSOCIATION_RETAIN_NONATOMIC); objc_setAssociatedObject(self, &imageURLKey, url, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
@ -95,7 +95,7 @@ static char TAG_ACTIVITY_SHOW;
} }
} }
- (void)sd_setImageWithPreviousCachedImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock { - (void)sd_setImageWithPreviousCachedImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDExternalCompletionBlock)completedBlock {
NSString *key = [[SDWebImageManager sharedManager] cacheKeyForURL:url]; NSString *key = [[SDWebImageManager sharedManager] cacheKeyForURL:url];
UIImage *lastPreviousCachedImage = [[SDImageCache sharedImageCache] imageFromDiskCacheForKey:key]; UIImage *lastPreviousCachedImage = [[SDImageCache sharedImageCache] imageFromDiskCacheForKey:key];