UIView Animation Blocks vs CAAnimation
Asked Answered
A

2

8

iOS animation experts! What are the pros and cons of each method? I know Apple recommends blocks instead of the old UIView animation methods (UIView beginAnimations, etc), but what about CAAnimation? When would you use one method vs the other? Is there a tradeoff in terms of performance?

Ariminum answered 11/8, 2011 at 10:38 Comment(0)
S
10

1) There is not much difference in terms of memory expenses between UIView's animation blocks and CALayers's CAAnimation nor in terms of the objects themselves.

2) There are limitations to the type of animations you can achieve with UIView's animation, so you might be forced to use CAAnimation anyway.

3) For those types of simpler animations that UIView can handle, it is usually a simpler API to use than that of CAAnimation.

Sapele answered 11/8, 2011 at 11:0 Comment(1)
Thanks! I was kinda hoping for more of a discussion, but I guess this covers everything?Ariminum
R
2

As miamk said, there are limitations to the types of animations you can achieve using the [UIView animateWith] method series. Personally I use CAAnimation, but that is because I am accustom to setting up animations that way. I feel you have more control. I tend to spend a day making a CAAnimation really really fine-tuned and then add it to my UIView extensions class so any view can use it.

Ratline answered 19/10, 2011 at 3:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.