O'Reilly logo

iOS Core Animation: Advanced Techniques by Nick Lockwood

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

9. Layer Time

The biggest difference between time and space is that you can’t reuse time.

Merrick Furst

In the previous two chapters, we explored the various types of layer animation that can be implemented using CAAnimation and its subclasses. Animation is a change that happens over time, so timing is crucial to the whole concept. In this chapter, we will look at the CAMediaTiming protocol, which is how Core Animation keeps track of time.

The CAMediaTiming Protocol

The CAMediaTiming protocol defines a collection of properties that are used to control the passage of time during an animation. Both CALayer and CAAnimation conform to this protocol, so time can be controlled on both a per-layer and per-animation basis.

Duration and Repetition ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required