Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Several of the properties of CALayer are implicitly animatable. This means that changes to these properties are automatically animated when their setters are called. The property position is an implicitly animatable property. Sending the message setPosition: to a CALayer doesn’t just move the layer to a new position; it animates the change from the old position to the new one.
In this section, you will have the application respond to user taps: the boxLayer will move to wherever the user starts a touch. This change in position will be animated because position is an implicitly animatable property.
In HypnosisView.m, implement touchesBegan:withEvent: to change the layer’s position.