To understand the relationship between views and layers, it helps to look at an example. Figure 1-1
shows the view architecture from the ViewTransitions
sample application along with the relationship to the underlying Core Animation layers. The views in the application include a window (which is also a view), a generic
object that acts as a container view, an image view, a toolbar for displaying controls, and a bar button item (which is not a view itself but which manages a view internally). (The actual ViewTransitions
sample application includes an additional image view that is used to implement transitions. For simplicity, and because that view is usually hidden, it is not included in Figure 1-1
.) Every view has a corresponding layer object that can be accessed from that view’s
property. (Because a bar button item is not a view, you cannot access its layer directly.) Behind those layer objects are Core Animation rendering objects and ultimately the hardware buffers used to manage the actual bits on the screen.