Code Snippet: Getting the current frame of a UIViewAnimation

No Comments

I’ve got this information whilst coding Navigate Nigel. The issue I was having was when checking for the current frame of a UIImageView, it would return the end point of the UIViewAnimation. This is because Core Animation sets the frame to the end point, then deals with the animation. To get round this, it’s just one bit of code. In the code, I have named the object I am checking the frame for as “view” – this could count for any object in your application.

[[view.layer presentationLayer] frame]

And that’s all!

Leave a Reply