Do not break category API (cf previous commit)
This commit is contained in:
parent
2904559f54
commit
e5b0d22e64
|
@ -49,7 +49,7 @@ static char operationKey;
|
|||
id<SDWebImageOperation> operation = [SDWebImageManager.sharedManager downloadWithURL:url options:options progress:nil completed:^(UIImage *image, NSError *error, BOOL fromCache, BOOL finished)
|
||||
{
|
||||
if (image) self.image = image;
|
||||
if (completedBlock) completedBlock(image, error, fromCache, finished);
|
||||
if (completedBlock) completedBlock(image, error, fromCache);
|
||||
}];
|
||||
objc_setAssociatedObject(self, &operationKey, operation, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
||||
}
|
||||
|
|
|
@ -19,7 +19,8 @@ typedef enum
|
|||
SDWebImageProgressiveDownload = 1 << 3
|
||||
} SDWebImageOptions;
|
||||
|
||||
typedef void(^SDWebImageCompletedBlock)(UIImage *image, NSError *error, BOOL fromCache, BOOL finished);
|
||||
typedef void(^SDWebImageCompletedBlock)(UIImage *image, NSError *error, BOOL fromCache);
|
||||
typedef void(^SDWebImageCompletedWithFinishedBlock)(UIImage *image, NSError *error, BOOL fromCache, BOOL finished);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -95,7 +96,7 @@ typedef void(^SDWebImageCompletedBlock)(UIImage *image, NSError *error, BOOL fro
|
|||
- (id<SDWebImageOperation>)downloadWithURL:(NSURL *)url
|
||||
options:(SDWebImageOptions)options
|
||||
progress:(SDWebImageDownloaderProgressBlock)progressBlock
|
||||
completed:(SDWebImageCompletedBlock)completedBlock;
|
||||
completed:(SDWebImageCompletedWithFinishedBlock)completedBlock;
|
||||
|
||||
/**
|
||||
* Cancel all current opreations
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
- (id<SDWebImageOperation>)downloadWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock
|
||||
- (id<SDWebImageOperation>)downloadWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedWithFinishedBlock)completedBlock
|
||||
{
|
||||
// Very common mistake is to send the URL using NSString object instead of NSURL. For some strange reason, XCode won't
|
||||
// throw any warning for this type mismatch. Here we failsafe this error by allowing URLs to be passed as NSString.
|
||||
|
|
|
@ -48,7 +48,7 @@ static char operationKey;
|
|||
id<SDWebImageOperation> operation = [SDWebImageManager.sharedManager downloadWithURL:url options:options progress:nil completed:^(UIImage *image, NSError *error, BOOL fromCache, BOOL finished)
|
||||
{
|
||||
if (image) [self setImage:image forState:state];
|
||||
if (completedBlock) completedBlock(image, error, fromCache, finished);
|
||||
if (completedBlock) completedBlock(image, error, fromCache);
|
||||
}];
|
||||
objc_setAssociatedObject(self, &operationKey, operation, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ static char operationKey;
|
|||
id<SDWebImageOperation> operation = [SDWebImageManager.sharedManager downloadWithURL:url options:options progress:nil completed:^(UIImage *image, NSError *error, BOOL fromCache, BOOL finished)
|
||||
{
|
||||
if (image) [self setBackgroundImage:image forState:state];
|
||||
if (completedBlock) completedBlock(image, error, fromCache, finished);
|
||||
if (completedBlock) completedBlock(image, error, fromCache);
|
||||
}];
|
||||
objc_setAssociatedObject(self, &operationKey, operation, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ static char operationKey;
|
|||
}
|
||||
if (completedBlock)
|
||||
{
|
||||
completedBlock(image, error, fromCache, finished);
|
||||
completedBlock(image, error, fromCache);
|
||||
}
|
||||
}];
|
||||
objc_setAssociatedObject(self, &operationKey, operation, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
||||
|
|
Loading…
Reference in New Issue