rs/SDWebImage — Issue #71: Adding UIActivityIndicator
Author: justdan0227
Created: 2012-02-23 02:09:07+00:00
State: open

I know this is not an issue but more of a request. I tried to add an UIActivityIndicator but its not showing:

- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options
{
SDWebImageManager *manager = [SDWebImageManager sharedManager];

// Remove in progress downloader from queue
[manager cancelForDelegate:self];

self.image = placeholder;

UIActivityIndicatorView *aiView = (UIActivityIndicatorView *)[self viewWithTag:1001];

if (aiView == nil){

aiView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
aiView.tag = 1001;
aiView.hidesWhenStopped = YES;
aiView.center = self.center;
[self addSubview:aiView];
[aiView startAnimating];
[aiView release];
}

if (url)
{
[manager downloadWithURL:url delegate:self options:options];
}
}