Revert the changes to use super.image, make it still possible for subclassing and override

This commit is contained in:
DreamPiggy 2019-09-04 17:55:09 +08:00
parent eb05b9f4fc
commit bba155421a
1 changed files with 2 additions and 2 deletions

View File

@ -191,7 +191,7 @@ static NSUInteger SDDeviceFreeMemory() {
- (void)setImage:(UIImage *)image
{
if (super.image == image) {
if (self.image == image) {
return;
}
@ -549,7 +549,7 @@ static NSUInteger SDDeviceFreeMemory() {
// We must use `image.class conformsToProtocol:` instead of `image conformsToProtocol:` here
// Because UIKit on macOS, using internal hard-coded override method, which returns NO
if ([image.class conformsToProtocol:@protocol(SDAnimatedImage)] && image.sd_isIncremental) {
UIImage *previousImage = super.image;
UIImage *previousImage = self.image;
if ([previousImage.class conformsToProtocol:@protocol(SDAnimatedImage)] && previousImage.sd_isIncremental) {
NSData *previousData = [((UIImage<SDAnimatedImage> *)previousImage) animatedImageData];
NSData *currentData = [((UIImage<SDAnimatedImage> *)image) animatedImageData];