title: Show activity indicator in SDWebImage
body: <p>I'm using SDWebView image and i want to show an Activity Indicator as placeholder, while fetching the image from remote.</p>
  
  <p>I tried Malek's answer here <a href="https://stackoverflow.com/questions/9388372/how-to-show-an-activity-indicator-in-sdwebimage">How to show an activity indicator in SDWebImage</a>, but it seems that </p>
  
  <pre><code>UIImage *cachedImage = [manager imageWithURL:url];
  </code></pre>
  
  <p>is deprecated.</p>
  
  <p>Is there anyone using this library that could tell me how can i insert an Activity Indicator while loading the image?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Following the indications of Michael Frederick, i ended up with this code and everything's working fine.</p>
  
  <pre><code>UIActivityIndicatorView *activityIndicator = [[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite] autorelease];
  activityIndicator.hidesWhenStopped = YES;
  activityIndicator.hidden = NO;
  [activityIndicator startAnimating];
  activityIndicator.center = CGPointMake(self.tipImage.frame.size.width /2, self.tipImage.frame.size.height/2);
  [imageView setImageWithURL:[NSURL URLWithString:imageString]
            placeholderImage:nil options:SDWebImageProgressiveDownload
                     success:^(UIImage *image) { [activityIndicator stopAnimating];[activityIndicator removeFromSuperview]; }
                     failure:^(NSError *error) {  [activityIndicator stopAnimating];[activityIndicator removeFromSuperview]; }];
  
  [imageView addSubview:activityIndicator];
  </code></pre>