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

2. The Backing Image

A picture is worth a thousand words. An interface is worth a thousand pictures.

Ben Shneiderman

Chapter 1, “The Layer Tree,” introduced the CALayer class and created a simple layer with a blue background. Background colors are all very well, but layers would be rather boring if all they could display was a flat color. A CALayer can actually contain a picture of anything you like. This chapter explores the backing image of CALayer.

The contents Image

CALayer has a property called contents. This property’s type is defined as id, implying that it can be any kind of object. This is true—in the sense that you can assign any object you like to the contents property and your app will still compile—however, in practice, if you supply ...

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