Quote:
Originally Posted by smithdale87
I believe if you want to do this, you'll need to animate the imageviews manually -- that is, set up an NSTimer and change the imageview frame when the timer is fired.
Then, with each iteration of the timer, you can also do your collision checking. The problem with UIAnimations is that the frame property is not updated during the animation.
|
The way Core Animation works is to have three "layers" (I suggest looking at
Core Animation Rendering Architecture): There is the layer tree, presentation tree and render tree. When you make changes or commit animations, the final values are instantly applied to the layer tree. The presentation tree contains, at all times, the values used by the render tree. The "problem" in hit detection is that the UIView geometry properties return the layer tree values, and we'd need the presentation tree values to detect hits and collisions. Fortunately, it's easy enough to get them: UIView's layer property returns the CALayer for the view, and the CALayer's presentationLayer property return the presentation layer used, which contains the current, proper values.