Graphics Programs Reference
In-Depth Information
[spin setToValue:[NSNumber numberWithFloat:M_PI * 2.0]];
[spin setDuration:1.0];
// Set the timing function
CAMediaTimingFunction *tf = [CAMediaTimingFunction
functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
[spin setTimingFunction:tf];
// Kick off the animation by adding it to the layer
[[timeLabel layer] addAnimation:spin
forKey:@"spinAnimation"];
}
Build and run the application. Notice the log statements when the animation is complete.
If you press the button several times quickly, the animation in progress will be interrupted
by a new one. The interrupted animation will still send the message anima-
tionDidStop:finished: to its delegate; however, the finished flag will be NO .
Search WWH ::




Custom Search