diff --git a/SDWebImage/FLAnimatedImage/FLAnimatedImageView+WebCache.h b/SDWebImage/FLAnimatedImage/FLAnimatedImageView+WebCache.h index f046f7a6..c3896efb 100644 --- a/SDWebImage/FLAnimatedImage/FLAnimatedImageView+WebCache.h +++ b/SDWebImage/FLAnimatedImage/FLAnimatedImageView+WebCache.h @@ -153,7 +153,7 @@ - (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock; @end diff --git a/SDWebImage/FLAnimatedImage/FLAnimatedImageView+WebCache.m b/SDWebImage/FLAnimatedImage/FLAnimatedImageView+WebCache.m index 51833df0..203b9118 100644 --- a/SDWebImage/FLAnimatedImage/FLAnimatedImageView+WebCache.m +++ b/SDWebImage/FLAnimatedImage/FLAnimatedImageView+WebCache.m @@ -80,7 +80,7 @@ [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:(SDExternalCompletionBlock)completedBlock { +- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDImageLoaderProgressBlock)progressBlock completed:(SDExternalCompletionBlock)completedBlock { [self sd_setImageWithURL:url placeholderImage:placeholder options:options context:nil progress:progressBlock completed:completedBlock]; } @@ -88,7 +88,7 @@ placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { dispatch_group_t group = dispatch_group_create(); SDWebImageMutableContext *mutableContext; diff --git a/SDWebImage/MapKit/MKAnnotationView+WebCache.h b/SDWebImage/MapKit/MKAnnotationView+WebCache.h index 7fec73d8..f8a87555 100644 --- a/SDWebImage/MapKit/MKAnnotationView+WebCache.h +++ b/SDWebImage/MapKit/MKAnnotationView+WebCache.h @@ -123,7 +123,7 @@ - (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock; /** @@ -147,7 +147,7 @@ placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock; @end diff --git a/SDWebImage/MapKit/MKAnnotationView+WebCache.m b/SDWebImage/MapKit/MKAnnotationView+WebCache.m index c228249b..d72785ca 100644 --- a/SDWebImage/MapKit/MKAnnotationView+WebCache.m +++ b/SDWebImage/MapKit/MKAnnotationView+WebCache.m @@ -40,7 +40,7 @@ [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:completedBlock]; } -- (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { +- (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { [self sd_setImageWithURL:url placeholderImage:placeholder options:options context:nil progress:progressBlock completed:completedBlock]; } @@ -48,7 +48,7 @@ placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { __weak typeof(self)weakSelf = self; [self sd_internalSetImageWithURL:url diff --git a/SDWebImage/NSButton+WebCache.h b/SDWebImage/NSButton+WebCache.h index 0edb7a4b..1f854779 100644 --- a/SDWebImage/NSButton+WebCache.h +++ b/SDWebImage/NSButton+WebCache.h @@ -125,7 +125,7 @@ - (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock; /** @@ -149,7 +149,7 @@ placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock; #pragma mark - Alternate Image @@ -263,7 +263,7 @@ - (void)sd_setAlternateImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock; /** @@ -287,7 +287,7 @@ placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock; #pragma mark - Cancel diff --git a/SDWebImage/NSButton+WebCache.m b/SDWebImage/NSButton+WebCache.m index b8f5092b..30af27fb 100644 --- a/SDWebImage/NSButton+WebCache.m +++ b/SDWebImage/NSButton+WebCache.m @@ -44,7 +44,7 @@ static NSString * const SDAlternateImageOperationKey = @"NSButtonAlternateImageO [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:completedBlock]; } -- (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { +- (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { [self sd_setImageWithURL:url placeholderImage:placeholder options:options context:nil progress:progressBlock completed:completedBlock]; } @@ -52,7 +52,7 @@ static NSString * const SDAlternateImageOperationKey = @"NSButtonAlternateImageO placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { self.sd_currentImageURL = url; [self sd_internalSetImageWithURL:url @@ -94,7 +94,7 @@ static NSString * const SDAlternateImageOperationKey = @"NSButtonAlternateImageO [self sd_setAlternateImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:completedBlock]; } -- (void)sd_setAlternateImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { +- (void)sd_setAlternateImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { [self sd_setAlternateImageWithURL:url placeholderImage:placeholder options:options context:nil progress:progressBlock completed:completedBlock]; } @@ -102,7 +102,7 @@ static NSString * const SDAlternateImageOperationKey = @"NSButtonAlternateImageO placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { self.sd_currentAlternateImageURL = url; diff --git a/SDWebImage/SDAnimatedImageView+WebCache.h b/SDWebImage/SDAnimatedImageView+WebCache.h index 6a1b0fc1..91b29eb6 100644 --- a/SDWebImage/SDAnimatedImageView+WebCache.h +++ b/SDWebImage/SDAnimatedImageView+WebCache.h @@ -118,7 +118,7 @@ - (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock; /** @@ -142,7 +142,7 @@ placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock; @end diff --git a/SDWebImage/SDAnimatedImageView+WebCache.m b/SDWebImage/SDAnimatedImageView+WebCache.m index fa9407bb..bc8c08d8 100644 --- a/SDWebImage/SDAnimatedImageView+WebCache.m +++ b/SDWebImage/SDAnimatedImageView+WebCache.m @@ -39,7 +39,7 @@ [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:completedBlock]; } -- (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { +- (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { [self sd_setImageWithURL:url placeholderImage:placeholder options:options context:nil progress:progressBlock completed:completedBlock]; } @@ -47,7 +47,7 @@ placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { Class animatedImageClass = [SDAnimatedImage class]; SDWebImageMutableContext *mutableContext; diff --git a/SDWebImage/SDWebImageManager.h b/SDWebImage/SDWebImageManager.h index ecc47a68..40b78468 100644 --- a/SDWebImage/SDWebImageManager.h +++ b/SDWebImage/SDWebImageManager.h @@ -9,11 +9,10 @@ #import "SDWebImageCompat.h" #import "SDWebImageOperation.h" #import "SDImageCacheDefine.h" -#import "SDWebImageDownloader.h" +#import "SDImageLoader.h" #import "SDImageTransformer.h" #import "SDWebImageCacheKeyFilter.h" #import "SDWebImageCacheSerializer.h" -#import "SDImageLoader.h" typedef void(^SDExternalCompletionBlock)(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL); @@ -204,7 +203,7 @@ SDWebImageManager *manager = [SDWebImageManager sharedManager]; */ - (nullable SDWebImageCombinedOperation *)loadImageWithURL:(nullable NSURL *)url options:(SDWebImageOptions)options - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nonnull SDInternalCompletionBlock)completedBlock; /** @@ -222,7 +221,7 @@ SDWebImageManager *manager = [SDWebImageManager sharedManager]; - (nullable SDWebImageCombinedOperation *)loadImageWithURL:(nullable NSURL *)url options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nonnull SDInternalCompletionBlock)completedBlock; /** diff --git a/SDWebImage/SDWebImageManager.m b/SDWebImage/SDWebImageManager.m index 970d89bb..e4dd08b8 100644 --- a/SDWebImage/SDWebImageManager.m +++ b/SDWebImage/SDWebImageManager.m @@ -8,9 +8,8 @@ #import "SDWebImageManager.h" #import "SDImageCache.h" -#import "NSImage+Compatibility.h" +#import "SDWebImageDownloader.h" #import "UIImage+WebCache.h" -#import "SDAnimatedImage.h" #import "SDWebImageError.h" #define LOCK(lock) dispatch_semaphore_wait(lock, DISPATCH_TIME_FOREVER); @@ -116,14 +115,14 @@ static id _defaultImageLoader; return SDScaledImageForKey(key, image); } -- (SDWebImageCombinedOperation *)loadImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDInternalCompletionBlock)completedBlock { +- (SDWebImageCombinedOperation *)loadImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDImageLoaderProgressBlock)progressBlock completed:(SDInternalCompletionBlock)completedBlock { return [self loadImageWithURL:url options:options context:nil progress:progressBlock completed:completedBlock]; } - (SDWebImageCombinedOperation *)loadImageWithURL:(nullable NSURL *)url options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nonnull SDInternalCompletionBlock)completedBlock { // Invoking this method without a completedBlock is pointless NSAssert(completedBlock != nil, @"If you mean to prefetch the image, use -[SDWebImagePrefetcher prefetchURLs] instead"); @@ -188,7 +187,7 @@ static id _defaultImageLoader; url:(nullable NSURL *)url options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDInternalCompletionBlock)completedBlock { // Check whether we should query cache BOOL shouldQueryCache = (options & SDWebImageFromLoaderOnly) == 0; @@ -218,7 +217,7 @@ static id _defaultImageLoader; cachedImage:(nullable UIImage *)cachedImage cachedData:(nullable NSData *)cachedData cacheType:(SDImageCacheType)cacheType - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDInternalCompletionBlock)completedBlock { // Check whether we should download image from network BOOL shouldDownload = (options & SDWebImageFromCacheOnly) == 0; diff --git a/SDWebImage/UIButton+WebCache.h b/SDWebImage/UIButton+WebCache.h index 0dea5b7a..b10e3097 100644 --- a/SDWebImage/UIButton+WebCache.h +++ b/SDWebImage/UIButton+WebCache.h @@ -149,7 +149,7 @@ forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock; /** @@ -175,7 +175,7 @@ placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock; #pragma mark - Background Image @@ -308,7 +308,7 @@ forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock; /** @@ -333,7 +333,7 @@ placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock; #pragma mark - Cancel diff --git a/SDWebImage/UIButton+WebCache.m b/SDWebImage/UIButton+WebCache.m index 9df79587..9fd576af 100644 --- a/SDWebImage/UIButton+WebCache.m +++ b/SDWebImage/UIButton+WebCache.m @@ -76,7 +76,7 @@ static inline NSString * backgroundImageOperationKeyForState(UIControlState stat [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:options progress:nil completed:completedBlock]; } -- (void)sd_setImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { +- (void)sd_setImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:options context:nil progress:progressBlock completed:completedBlock]; } @@ -85,7 +85,7 @@ static inline NSString * backgroundImageOperationKeyForState(UIControlState stat placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { if (!url) { [self.sd_imageURLStorage removeObjectForKey:imageURLKeyForState(state)]; @@ -156,7 +156,7 @@ static inline NSString * backgroundImageOperationKeyForState(UIControlState stat [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:0 progress:nil completed:completedBlock]; } -- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { +- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:0 context:nil progress:progressBlock completed:completedBlock]; } @@ -165,7 +165,7 @@ static inline NSString * backgroundImageOperationKeyForState(UIControlState stat placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { if (!url) { [self.sd_imageURLStorage removeObjectForKey:backgroundImageURLKeyForState(state)]; diff --git a/SDWebImage/UIImageView+HighlightedWebCache.h b/SDWebImage/UIImageView+HighlightedWebCache.h index c806e5f2..a29782ba 100644 --- a/SDWebImage/UIImageView+HighlightedWebCache.h +++ b/SDWebImage/UIImageView+HighlightedWebCache.h @@ -86,7 +86,7 @@ */ - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url options:(SDWebImageOptions)options - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock; @end diff --git a/SDWebImage/UIImageView+HighlightedWebCache.m b/SDWebImage/UIImageView+HighlightedWebCache.m index e4dd3a51..9cc34fb8 100644 --- a/SDWebImage/UIImageView+HighlightedWebCache.m +++ b/SDWebImage/UIImageView+HighlightedWebCache.m @@ -33,14 +33,14 @@ static NSString * const SDHighlightedImageOperationKey = @"UIImageViewImageOpera [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:completedBlock]; } -- (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDExternalCompletionBlock)completedBlock { +- (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDImageLoaderProgressBlock)progressBlock completed:(SDExternalCompletionBlock)completedBlock { [self sd_setHighlightedImageWithURL:url options:options context:nil progress:progressBlock completed:completedBlock]; } - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { __weak typeof(self)weakSelf = self; SDWebImageMutableContext *mutableContext; diff --git a/SDWebImage/UIImageView+WebCache.h b/SDWebImage/UIImageView+WebCache.h index 1347f18d..c732b21c 100644 --- a/SDWebImage/UIImageView+WebCache.h +++ b/SDWebImage/UIImageView+WebCache.h @@ -148,7 +148,7 @@ - (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock; /** @@ -172,7 +172,7 @@ placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock; #if SD_UIKIT diff --git a/SDWebImage/UIImageView+WebCache.m b/SDWebImage/UIImageView+WebCache.m index 63c19239..9ad97aed 100644 --- a/SDWebImage/UIImageView+WebCache.m +++ b/SDWebImage/UIImageView+WebCache.m @@ -37,7 +37,7 @@ [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:completedBlock]; } -- (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { +- (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { [self sd_setImageWithURL:url placeholderImage:placeholder options:options context:nil progress:progressBlock completed:completedBlock]; } @@ -45,7 +45,7 @@ placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { [self sd_internalSetImageWithURL:url placeholderImage:placeholder diff --git a/SDWebImage/UIView+WebCache.h b/SDWebImage/UIView+WebCache.h index d674d9a1..10a383d3 100644 --- a/SDWebImage/UIView+WebCache.h +++ b/SDWebImage/UIView+WebCache.h @@ -66,7 +66,7 @@ typedef void(^SDSetImageBlock)(UIImage * _Nullable image, NSData * _Nullable ima options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context setImageBlock:(nullable SDSetImageBlock)setImageBlock - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDInternalCompletionBlock)completedBlock; /** diff --git a/SDWebImage/UIView+WebCache.m b/SDWebImage/UIView+WebCache.m index dfe1ae7b..b2b3f4c5 100644 --- a/SDWebImage/UIView+WebCache.m +++ b/SDWebImage/UIView+WebCache.m @@ -40,7 +40,9 @@ const int64_t SDWebImageProgressUnitCountUnknown = 1LL; placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - setImageBlock:(nullable SDSetImageBlock)setImageBlock progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock completed:(nullable SDInternalCompletionBlock)completedBlock { + setImageBlock:(nullable SDSetImageBlock)setImageBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock + completed:(nullable SDInternalCompletionBlock)completedBlock { context = [context copy]; // copy to avoid mutable object NSString *validOperationKey = nil; if ([context valueForKey:SDWebImageContextSetImageOperationKey]) { @@ -90,7 +92,7 @@ const int64_t SDWebImageProgressUnitCountUnknown = 1LL; } __weak __typeof(self)wself = self; - SDWebImageDownloaderProgressBlock combinedProgressBlock = ^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) { + SDImageLoaderProgressBlock combinedProgressBlock = ^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) { __strong __typeof (wself) sself = wself; NSProgress *imageProgress = sself.sd_imageProgress; imageProgress.totalUnitCount = expectedSize;