Access to intermediate points when animating a UIView

I am animating an image in a UIImageView. This works great with Core Animation. Now I want to attach one end of the line to the center of this UIIMageView. But with Core Animation, I only get the start point and end point of the UIImageView. Is it possible to access the intermediate points during the animation? I want to extend the functionality for many UIImageViews that are animated, with a string attached to them. I do not want to create timers to monitor all animations and calculate my own time points. Does anyone have any suggestions? Thanks!

Bye, Björn

+4
source share
2 answers

If you use Core Animation (I'm not sure if this works with strictly UIView-based animations), you can get the specific instantaneous value of your property by looking at the presentationLayer property of your CALayer view. This property provides a read-only copy of the current set of values ​​as an animation of the layer. You can look at it under the "timer" link and update something else, etc.

I have a hard time, accurately representing what you are trying to accomplish as a whole, but it can get you started.

+4
source

I found this post that points in the right direction: http://dbachrach.com/blog/2008/04/instantaneous-frame-of-moving-core-animation-views/ But there is one more problem: this seems to work CABasicAnimations only, not standard animations. Is there a way to access intermediate points using standard animations ([UIView beginAnimation] ...)? Thanks.

Bjorn

0
source

All Articles