views:

50

answers:

2

Hi,

I'm animating an image in an UIImageView. This works just great with Core Animation. Now I want to attach one end of a line permanentely to the center of this UIIMageView. But with Core Animation I only get the starting point and the end point of the UIImageView. Is there a possibility to access interim points during the animation? I want to extend the functionality to many UIImageViews, which are animated, with a line attached to them. I don't want to create timers to monitor all animations and calculate my own interim points. Does somebody have any suggestions? Thanks!

Bye, Björn

+1  A: 

If you're using Core Animation (I'm not sure if this works with strictly UIView-based animation), you should be able to get a particular instantaneous value of your property by looking at the presentationLayer property of your view's backing CALayer. That property exposes a read-only copy of the current set of values as a layer is animating. You can look at this on a display link "timer" and update something else, etc.

I'm having a tough time picturing exactly what you're trying to accomplish overall, but this might get you started.

quixoto
Thanks for the answer. I will check it out.
Bjoern
I'm trying to implement a visualization of several images. These images have relations to a "main" image. If the user moves a image, the lines should stay attached to the images. And other images should arrange themself in a way that no images overlap other images.
Bjoern
A: 

Hi!

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

Björn

Bjoern