Implicitly Animatable Properties
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.
- (void)touchesBegan:(NSSet ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access