title: Wait for Animation to finish in iOS?
body: <p>I want to execute doSomethingElse after the animation is finished. Another constraint is that the animation code can be of different duration. How can I do that? thanks!</p>
  
  <pre><code>-(void) doAnimationThenSomethingElse {
    [self doAnimation];
    [self doSomethingElse];
  }
  </code></pre>
  
  <p>This for example doesn't work:</p>
  
  <pre><code>animationDuration = 1;
  [UIView animateWithDuration:animationDuration
      animations:^{
        [self doAnimation];
      } completion:^(BOOL finished) {
        [self doSomethingElse];
      }
  ];
  </code></pre>