iOS NOTES - iOS ANIMATIONSSun, May 3, 2015
iOS Animation API Clusters From Top to Bottom
In general there are 2 groups of APIs: the view based animation APIs & the underlying Core Animation APIs that is backing the former.
They are the oldest APIs before block was introduced into the framework, with
begin...to start recording an animation, a bunch of
setAnimation...to be called subsequently to set configure various animations detailes, and then ends with a
UIView block based APIs
In iOS 4.0, block was introduced to facilitates the creation of UIView animations (replacing the old
Note that during the animation block, you can still call the
setAnimation...functions to tweak details of animation.
The full form of the function accepts 5 arguments:
The animation block
The block based animation is just like creating, configuring & adding
CABasicAnimationto layers of each involved view in the block.
UIView spring Animation
As its name suggests, it can do some kind of underdamped oscillation. It arguments list is similar to full form of block based function, with two more paramters:
UIView view transition APIs
2 convenient methods were added to faciliate the common occasions when you want to animation subview changes in one view a whole, or replacing one view with another.
UIView key frame Based APIs
It only have 2 methods, call
animateKeyframes...to start the whole animation, and within a block, call
addKeyframe...multiple times with apprioate relative timming setting to layout the key frames duraing the whole animation.
Using it is just like adding
CAKeyframeAnimationto the layer of involved views in the block.
Provided by the Quartz Core framework from Media Layer. It is the basis of everything mentioned above.
It provides concepts of layer, animcation object, animation transaction, etc. When you can not achieve effect you want through APIs listed above, come for it.