title: How to cancel UIViews block-based animation?
body: <p>i currently focus the following problem:</p>
  
  <p>i start an animation, where 2 objects-attributes are triggered.</p>
  
  <p>the code is:</p>
  
  <pre><code>    [UIView animateWithDuration:0.3 animations:^{
          greyscaleImage.alpha     = 1;
          activityIndicator.alpha  = 1;
      } completion:^(BOOL f){
          if(f)
          {
              [activityIndicator startAnimating];
          }
      }];
  </code></pre>
  
  <p>which works fine.</p>
  
  <p>the only problem i discovered is, that i have a 0.3 seconds change to crash the app when the view which holds this activityIndicator and greyscaleImage is deallocated. </p>
  
  <p>To make it more clear please imagine a ViewController, its view presented via default iOS-modal-View ways. Now trigger that animation, which takes 2 minutes. before reaching that 2 minutes, you find that animation is quite boring and you want to dismiss that view. now, that the view, activityIndicator and greyscaleImage are released, the animation o/c cannot know what to do.</p>
  
  <p>so i wonder, what to do here + why the debugger points to</p>
  
  <pre><code>  } completion:^(BOOL f){
  </code></pre>
  
  <p>instead of e.g. [activityIndicator ...</p>
  
  <p>is there a way, to allow user to dismiss the view before the 2 minutes are over? </p>
  
  <p>Best Regards</p>