Do not call completed block on categories for intermediate progressive images
This commit is contained in:
parent
e5b0d22e64
commit
b29bb2e2e1
|
@ -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);
|
||||
if (completedBlock && finished) completedBlock(image, error, fromCache);
|
||||
}];
|
||||
objc_setAssociatedObject(self, &operationKey, operation, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
if (completedBlock && finished) 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);
|
||||
if (completedBlock && finished) completedBlock(image, error, fromCache);
|
||||
}];
|
||||
objc_setAssociatedObject(self, &operationKey, operation, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ static char operationKey;
|
|||
self.image = image;
|
||||
[self setNeedsLayout];
|
||||
}
|
||||
if (completedBlock)
|
||||
if (completedBlock && finished)
|
||||
{
|
||||
completedBlock(image, error, fromCache);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue