...
|
...
|
@@ -33,13 +33,20 @@ |
|
|
{
|
|
|
if (self.imageURL)
|
|
|
{
|
|
|
UIActivityIndicatorView *activityIndicator;
|
|
|
[self.imageView addSubview:activityIndicator = [UIActivityIndicatorView.alloc initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]];
|
|
|
activityIndicator.center = self.imageView.center;
|
|
|
[activityIndicator startAnimating];
|
|
|
[self.imageView setImageWithURL:self.imageURL placeholderImage:nil options:SDWebImageProgressiveDownload completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType)
|
|
|
__block UIActivityIndicatorView *activityIndicator;
|
|
|
[self.imageView setImageWithURL:self.imageURL placeholderImage:nil options:SDWebImageProgressiveDownload progress:^(NSUInteger receivedSize, long long expectedSize)
|
|
|
{
|
|
|
if (!activityIndicator)
|
|
|
{
|
|
|
[self.imageView addSubview:activityIndicator = [UIActivityIndicatorView.alloc initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]];
|
|
|
activityIndicator.center = self.imageView.center;
|
|
|
[activityIndicator startAnimating];
|
|
|
}
|
|
|
}
|
|
|
completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType)
|
|
|
{
|
|
|
[activityIndicator removeFromSuperview];
|
|
|
activityIndicator = nil;
|
|
|
}];
|
|
|
}
|
|
|
}
|
...
|
...
|
|