title: Activity indicator while downloading images iOS
body: <p>I'm download an array of images to create animation. How can I make when download starts to show activity indicator and when it finishes to hide activity indicator. </p>
  
  <pre><code>self.img = [[UIImageView alloc] initWithFrame:CGRectMake(0, 65, self.view.frame.size.width, self.view.frame.size.width-70)];
  
  
  
          img.animationImages = [NSArray arrayWithObjects:
  
                                     [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"URL"]]],
  
                                     [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"URL"]]],
  
                                     [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"URL"]]],
  
                                     [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"URL"]]],
  
  
  
  
          img.animationDuration = 20.0f;
  
          img.animationRepeatCount = 0;
  
          [img startAnimating];
  
          [self.view addSubview: img];
  </code></pre>