I have UIView animation
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:25];
myview.frame = CGRectMake(218, 216, myview.frame.size.width * 0.5, myview.frame.size.height * 0.5);
[UIView commitAnimations];
and NSTimer with callback method. The question: is it possible to get current myview.frame size and origin inside timer callback method?
or may be there is another way to trace it?
The view's frame is not updated during animation, as you have figured out. You could try
myview.layer.frame
(just a guess, though I suspect that will not work either).NWCoder is right. I will give you an example in C# since I code in MonoTouch.
The code block above will move yourView from 0,0 to 100,100 in 120 seconds. The moment the animation starts, yourView.Frame is already set to (100,100,100,100)...so yourView.Frame.X will equal 100 for the entire 120 seconds.
On the other hand, if you use the first line below any time during the 120 seconds...
...you are in business. You will get the live frame properties while animating.
Works great. I'm using it in my app now.
I'm pretty sure that it's not possible, because when you change theframe
of your view it takes effect immediately. In the background,Core Animation
takes care of the animation. So, even if you could grab the frame, it'd give you the final coordinates, not the current coordinates in the midst of an animation.Access the presentation layer of the property, as pointed out by
NWCoder
in the comments. See the documentation.