I\'m using SDWebView image and i want to show an Activity Indicator as placeholder, while fetching the image from remote.
I tried Malek\'s answer here How to show an act
That's my solution. In that file : UIImageView+WebCache.m
Find that method and change like that:
- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder
{
UIActivityIndicatorView *activity = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:(UIActivityIndicatorViewStyleGray)];
[activity startAnimating];
[activity setFrame:CGRectMake(self.frame.origin.x - 20, self.frame.origin.y - 10, self.frame.size.width, self.frame.size.height)];
[self addSubview:activity];
//[self setImageWithURL:url placeholderImage:placeholder options:0 progress:nil completed:nil];
[self setImageWithURL:url
placeholderImage:placeholder
options:0
completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType)
{
[activity removeFromSuperview];
}];
}