|
9 | 9 | // |
10 | 10 |
|
11 | 11 | #import "ASNetworkImageNode.h" |
12 | | -#import "ASImageNode+Private.h" |
13 | 12 |
|
14 | 13 | #import "ASBasicImageDownloader.h" |
15 | 14 | #import "ASDisplayNodeInternal.h" |
@@ -137,7 +136,12 @@ - (void)setImage:(UIImage *)image |
137 | 136 | } |
138 | 137 | __instanceLock__.unlock(); |
139 | 138 |
|
140 | | - [self __setImage:image]; |
| 139 | + [self _setImage:image]; |
| 140 | +} |
| 141 | + |
| 142 | +- (void)_setImage:(UIImage *)image |
| 143 | +{ |
| 144 | + super.image = image; |
141 | 145 | } |
142 | 146 |
|
143 | 147 | - (void)setURL:(NSURL *)URL |
@@ -167,7 +171,7 @@ - (void)setURL:(NSURL *)URL resetToDefault:(BOOL)reset |
167 | 171 |
|
168 | 172 | BOOL hasURL = _URL == nil; |
169 | 173 | if (reset || hasURL) { |
170 | | - [self __setImage:_defaultImage]; |
| 174 | + [self _setImage:_defaultImage]; |
171 | 175 | /* We want to maintain the order that currentImageQuality is set regardless of the calling thread, |
172 | 176 | so always use a dispatch_async to ensure that we queue the operations in the correct order. |
173 | 177 | (see comment in displayDidFinish) */ |
@@ -202,7 +206,7 @@ - (void)setDefaultImage:(UIImage *)defaultImage |
202 | 206 | dispatch_async(dispatch_get_main_queue(), ^{ |
203 | 207 | self.currentImageQuality = hasURL ? 0.0 : 1.0; |
204 | 208 | }); |
205 | | - [self __setImage:defaultImage]; |
| 209 | + [self _setImage:defaultImage]; |
206 | 210 | } |
207 | 211 | } |
208 | 212 |
|
@@ -287,7 +291,7 @@ - (void)displayWillStartAsynchronously:(BOOL)asynchronously |
287 | 291 | if (_imageLoaded == NO && _URL && _downloadIdentifier == nil) { |
288 | 292 | UIImage *result = [[_cache synchronouslyFetchedCachedImageWithURL:_URL] asdk_image]; |
289 | 293 | if (result) { |
290 | | - [self __setImage:result]; |
| 294 | + [self _setImage:result]; |
291 | 295 | _imageLoaded = YES; |
292 | 296 | dispatch_async(dispatch_get_main_queue(), ^{ |
293 | 297 | _currentImageQuality = 1.0; |
@@ -372,7 +376,7 @@ - (void)handleProgressImage:(UIImage *)progressImage progress:(CGFloat)progress |
372 | 376 | if (ASObjectIsEqual(_downloadIdentifier, downloadIdentifier) == NO && downloadIdentifier != nil) { |
373 | 377 | return; |
374 | 378 | } |
375 | | - [self __setImage:progressImage]; |
| 379 | + [self _setImage:progressImage]; |
376 | 380 | dispatch_async(dispatch_get_main_queue(), ^{ |
377 | 381 | // See comment in -displayDidFinish for why this must be dispatched to main |
378 | 382 | self.currentImageQuality = progress; |
@@ -437,7 +441,7 @@ - (void)_clearImage |
437 | 441 | ASPerformBackgroundDeallocation(image); |
438 | 442 | } |
439 | 443 | self.animatedImage = nil; |
440 | | - [self __setImage:_defaultImage]; |
| 444 | + [self _setImage:_defaultImage]; |
441 | 445 | _imageLoaded = NO; |
442 | 446 | // See comment in -displayDidFinish for why this must be dispatched to main |
443 | 447 | dispatch_async(dispatch_get_main_queue(), ^{ |
@@ -497,7 +501,7 @@ - (void)_lazilyLoadImageIfNecessary |
497 | 501 |
|
498 | 502 | dispatch_async(dispatch_get_main_queue(), ^{ |
499 | 503 | if (self.shouldCacheImage) { |
500 | | - [self __setImage:[UIImage imageNamed:_URL.path.lastPathComponent]]; |
| 504 | + [self _setImage:[UIImage imageNamed:_URL.path.lastPathComponent]]; |
501 | 505 | } else { |
502 | 506 | // First try to load the path directly, for efficiency assuming a developer who |
503 | 507 | // doesn't want caching is trying to be as minimal as possible. |
@@ -527,7 +531,7 @@ - (void)_lazilyLoadImageIfNecessary |
527 | 531 | if (animatedImage != nil) { |
528 | 532 | self.animatedImage = animatedImage; |
529 | 533 | } else { |
530 | | - [self __setImage:nonAnimatedImage]; |
| 534 | + [self _setImage:nonAnimatedImage]; |
531 | 535 | } |
532 | 536 | } |
533 | 537 |
|
@@ -563,7 +567,7 @@ - (void)_lazilyLoadImageIfNecessary |
563 | 567 | if ([imageContainer asdk_animatedImageData] && _downloaderFlags.downloaderImplementsAnimatedImage) { |
564 | 568 | strongSelf.animatedImage = [_downloader animatedImageWithData:[imageContainer asdk_animatedImageData]]; |
565 | 569 | } else { |
566 | | - [strongSelf __setImage:[imageContainer asdk_image]]; |
| 570 | + [strongSelf _setImage:[imageContainer asdk_image]]; |
567 | 571 | } |
568 | 572 | dispatch_async(dispatch_get_main_queue(), ^{ |
569 | 573 | strongSelf->_currentImageQuality = 1.0; |
|
0 commit comments