old mode 100755
new mode 100644
| | |
| | | @implementation UIImageView (AFNetworking) |
| | | |
| | | + (AFImageDownloader *)sharedImageDownloader { |
| | | |
| | | #pragma clang diagnostic push |
| | | #pragma clang diagnostic ignored "-Wgnu" |
| | | return objc_getAssociatedObject(self, @selector(sharedImageDownloader)) ?: [AFImageDownloader defaultInstance]; |
| | | #pragma clang diagnostic pop |
| | | } |
| | | |
| | | + (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader { |
| | |
| | | success:(void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success |
| | | failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure |
| | | { |
| | | |
| | | |
| | | if ([urlRequest URL] == nil) { |
| | | [self cancelImageDownloadTask]; |
| | | self.image = placeholderImage; |
| | | if (failure) { |
| | | NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorBadURL userInfo:nil]; |
| | | failure(urlRequest, nil, error); |
| | | } |
| | | return; |
| | | } |
| | | |
| | | |
| | | if ([self isActiveTaskURLEqualToURLRequest:urlRequest]){ |
| | | return; |
| | | } |
| | | |
| | | |
| | | [self cancelImageDownloadTask]; |
| | | |
| | | AFImageDownloader *downloader = [[self class] sharedImageDownloader]; |