...
|
...
|
@@ -8,6 +8,10 @@ |
|
|
|
|
|
#import "SDWebImagePrefetcher.h"
|
|
|
|
|
|
#if !defined(DEBUG) && !defined (SD_VERBOSE)
|
|
|
#define NSLog(...)
|
|
|
#endif
|
|
|
|
|
|
@interface SDWebImagePrefetcher ()
|
|
|
|
|
|
@property (strong, nonatomic) SDWebImageManager *manager;
|
...
|
...
|
@@ -60,17 +64,13 @@ |
|
|
if (self.progressBlock) {
|
|
|
self.progressBlock(self.finishedCount,[self.prefetchURLs count]);
|
|
|
}
|
|
|
#ifdef SD_VERBOSE
|
|
|
NSLog(@"Prefetched %d out of %d", self.finishedCount, self.prefetchURLs.count);
|
|
|
#endif
|
|
|
NSLog(@"Prefetched %@ out of %@", @(self.finishedCount), @(self.prefetchURLs.count));
|
|
|
}
|
|
|
else {
|
|
|
if (self.progressBlock) {
|
|
|
self.progressBlock(self.finishedCount,[self.prefetchURLs count]);
|
|
|
}
|
|
|
#ifdef SD_VERBOSE
|
|
|
NSLog(@"Prefetched %d out of %d (Failed)", self.finishedCount, [self.prefetchURLs count]);
|
|
|
#endif
|
|
|
NSLog(@"Prefetched %@ out of %@ (Failed)", @(self.finishedCount), @(self.prefetchURLs.count));
|
|
|
|
|
|
// Add last failed
|
|
|
self.skippedCount++;
|
...
|
...
|
@@ -100,9 +100,7 @@ |
|
|
|
|
|
- (void)reportStatus {
|
|
|
NSUInteger total = [self.prefetchURLs count];
|
|
|
#ifdef SD_VERBOSE
|
|
|
NSLog(@"Finished prefetching (%d successful, %d skipped, timeElasped %.2f)", total - self.skippedCount, self.skippedCount, CFAbsoluteTimeGetCurrent() - self.startedTime);
|
|
|
#endif
|
|
|
NSLog(@"Finished prefetching (%@ successful, %@ skipped, timeElasped %.2f)", @(total - self.skippedCount), @(self.skippedCount), CFAbsoluteTimeGetCurrent() - self.startedTime);
|
|
|
if ([self.delegate respondsToSelector:@selector(imagePrefetcher:didFinishWithTotalCount:skippedCount:)]) {
|
|
|
[self.delegate imagePrefetcher:self
|
|
|
didFinishWithTotalCount:(total - self.skippedCount)
|
...
|
...
|
|