Bouncing with a CAKeyframeAnimation
For practice with CAKeyframeAnimation, you are going to make the time label grow and shrink to give it a bouncing effect (Figure 23.7).
Figure 23.7 Current time mid-bounce
Declare a new method in TimeViewController.h.
- (void)bounceTimeLabel;
In TimeViewController.m, replace the code that spins the label in showCurrentTime: with a call to bounceTimeLabel.
- (IBAction)showCurrentTime:(id)sender { NSDate *now = [NSDate date]; static NSDateFormatter *formatter = nil; ...
Get iOS Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.