title: Stop animating UIActivityIndicatorView when UIImageView image has finished loading
body: <p>I want to display the spinning activity view over a UIImageView and stop and hide the activity view once the image has finished loading and is displayed. The image is a large photograph taken from the assets-library. </p>
  
  <pre><code>- (void)viewDidLoad
  {
      //set photo
      UIImageView *Photo = _photo;
      NSURL *url = [[NSURL alloc] initWithString:project.photo];
      ALAssetsLibrary* library = [[ALAssetsLibrary alloc] init];
  
      [library assetForURL:url resultBlock:^(ALAsset *asset) {
  
          ALAssetRepresentation *rep = [asset defaultRepresentation];
          CGImageRef iref = [rep fullResolutionImage];
          if (iref) {
              self.photo.image = [UIImage imageWithCGImage:[rep fullScreenImage] scale:[rep scale] orientation:0];
  
          }
               } failureBlock:^(NSError *error) {
  
                   NSLog(@"Couldn't load asset %@ =&gt; %@", error, [error localizedDescription]);
  
  
  
               }];
  
      [_ImageLoader stopAnimating];
  }
  </code></pre>
  
  <p>This, however, does not work as the activity view is constantly spinning.</p>