February 2014
Intermediate to advanced
560 pages
18h 58m
English
It can often be useful to know when an animation completes. For instance, you might want to chain different kinds of animations together or update another object when the animation completes. To know when the animation finishes, pass a block for the completion argument.
Update BNRHypnosisViewController.m so that it logs a message to the console when the animations complete.
[UIView animateKeyframesWithDuration:1.0 delay:0.0 options:0 animations:^{ [UIView addKeyframeWithRelativeStartTime:0 relativeDuration:0.8 animations:^{ messageLabel.center = self.view.center; }]; [UIView addKeyframeWithRelativeStartTime:0.8 relativeDuration:0.2 animations:^{ int x = arc4random() % width; int y = arc4random() % height; messageLabel.center ...Read now
Unlock full access