O'Reilly logo

iOS Programming: The Big Nerd Ranch Guide by Joe Conway, Aaron Hillegass

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

Spinning with CABasicAnimation

In this section, you are going to use an animation object to spin the implicit layer of the time field in HypnoTime’s TimeViewController whenever it is updated (Figure 23.5). (Recall that an implicit layer is a layer created by a view when the view is instantiated. The time field is a UILabel, which is a subclass of UIView, so it has an implicit layer that we can animate.)

Figure 23.5  Current time mid-spin

Current time mid-spin

Open HypnoTime.xcodeproj.

The Core Animation code you will write in this exercise will be in TimeViewController.m. So import the header from the QuartzCore framework at the top of this file.

#​i​m​p​o​r​t​ ​<​Q​u​a​r​t​z​C​o​r​e​/​Q​u​a​r​t​z​C​o​r​e​.​h​>​ ...

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