简体   繁体   中英

In iOS, what's the difference between UIView Animations and Core Animations?

For instance I believe CGAffineTransform is core animation. I know how to rotate an object, scale and move an object in core animation but is there a way to do it in UIView Animation?

Apple describe in it's docs:

"In iOS, animations are used extensively to reposition views, change their size, remove them from view hierarchies, and hide them."

View Programming Guide - Apple

The article continues with a fairly strong emphasis on using Core Animations rather than UIView Animations for more detailed animations.

"In places where you want to perform more sophisticated animations, or animations not supported by the UIView class, you can use Core Animation and the view's underlying layer to create the animation. Because view and layer objects are intricately linked together, changes to a view's layer affect the view itself."

Same Doc - View Programming Guide - Apple

So basically put, you manipulate the view's layer to change the view. I don't think it wise to manipulate the view directly when Core Animations exist for this purpose. So my own answer is no, you can't (and probably shouldn't) do to the UIView with UIAnimations what you can do to the Layer with Core Animations.

More info: Core Animation Programming Guide by Apple

I hope this helps answer your question and that the resources provided will help further your insight into your question.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM