sach
sach

Reputation: 1069

How to find the co-ordinate of object which is in between of CAKeyframeAnimation?

Currently i am moving a png image using CAKeyframeAnimation along a path for 30 seconds. Is there any way to find the co-ordinate of imageview in between the animation? (lets say on 15th second of animation)

Upvotes: 0

Views: 111

Answers (1)

Vladimir
Vladimir

Reputation: 170839

Check presentationLayer in your imageview's layer - it contains all informations about layer's current state during animation. e.g. you can get current image center coordinates the following way:

CALayer *presLayer = [imageView.layer presentationLayer];
CGPoint currentCenter = presLayer.center;

Upvotes: 1

Related Questions