Kostia Dombrovsky
Kostia Dombrovsky

Reputation: 1647

CAAnimation track progress

I've been working recently on some animations and it struck me that there is no delegate method of CAAnimation that updates animation progress. I've tried to use a timer and request a transform from a view being transformed (rotated by z axis) but it always returns the same transform.

Is there any way to get the values being updated by CAAnimation?

Upvotes: 1

Views: 1086

Answers (2)

Deepak Danduprolu
Deepak Danduprolu

Reputation: 44633

If you want the details of the current state of the animation of a layer, query [layer presentationLayer]. You can access the transform property within that object.

Upvotes: 7

Anton
Anton

Reputation: 2297

Unfortunately, no. However, core animation is time based, so you can always mimic it independently. Also, if you are looking for some discrete precise moments, you can split your animation into a chain and update your state within the animationDidStop callback.

Upvotes: 0

Related Questions