title: Delay between UIActivityIndicatorView animation stop and content view refresh
body: <p>I have created a simple <code>UIActivityIndicatorView</code> that takes care of informing the user about the end of the execution for a specific task. My implementation is the following:</p>
  
  <pre><code>UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
  spinner.center = self.imageView.center;
  [self.imageView addSubview:spinner];
  [spinner startAnimating];
  
  dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
      UIImage *filteredImage = ...some filtering...;
      self.imageView.image = filteredImage;
      [self.imageView setNeedsDisplay];
  
      dispatch_async(dispatch_get_main_queue(), ^{
          [spinner stopAnimating];
      });
  
  });
  </code></pre>
  
  <p>However, when I run the application, the spinning wheel disappears and after a while the image is updated. Do you have any hint about how there is this delay?</p>
  
  <p>EDIT: the <code>setNeedsDisplay</code> and the <code>stopAnimating</code> instructions are called in the right order. However, the <code>UIImageView</code> takes a while in order to update its content.</p>
  
  <p>Thank you in advance.</p>