Chapter 9: Layers Like an Onion: Core Animation
The iPhone has made animation central to the mobile experience. Views slide in and out, applications zoom into place, pages fly into the bookmark list. Apple has made animation not just a beautiful part of the experience, but a better way to let the user know what’s happening and what to expect. When views slide into place from right to left, it’s natural to press the left-pointing button to go back to where you were. When you create a bookmark and it flies to the toolbar, it’s obvious where you should look to get back to that bookmark. These subtle cues are a critical part of making your user interface intuitive as well as engaging. To facilitate all this animation, iOS devices include a powerful GPU and frameworks that let you harness that GPU easily.
In this chapter, you discover the two main animation systems of iOS: view animations and the Core Animation framework. You find out how to draw with Core Animation layers and how to move layers around in two and three dimensions. Common decorations like rounded corners, colored borders, and shadows are trivial with CALayer
, and you discover how to apply them quickly and easily. You learn how to create custom automatic animations, including animating your own properties. Finally, Core Animation is all about performance, so you find out how to manage layers in multithreaded applications.
This chapter focuses on animations for view-based programming. These frameworks are ideal for ...