Animation Block - Completion fires immediately

animation, ios, uiview, uiviewcontroller

Solution

Because you're not actually animating anything (a NSLog cannot be animated). You need to animate an object or else the completion block will be called straight away. The 0.3 second duration will be ignored if there is nothing being animated.

Problem

Why does the following code log 'Done' as soon as it is fired? ``` [UIView animateWithDuration:0.3 animations:^{ NSLog(@"Start"); } completion:^(BOOL finished){ NSLog(@"done"); } ]; ```

Original source