CATransition ----- 是针对 layer's content. 的 变化

来源:互联网 发布:16年农村淘宝面试流程 编辑:程序博客网 时间:2024/06/05 19:52

Animation Classes and Timing

Core Animation provides an expressive set of animation classes you can use in your application:

  • CABasicAnimation provides simple interpolation between values for a layer property.

  • CAKeyframeAnimation provides support for key frame animation. You specify the key path of the layer property to be animated, an array of values that represent the value at each stage of the animation, as well as arrays of key frame times and timing functions. As the animation runs, each value is set in turn using the specified interpolation.

  • CATransition provides a transition effect that affects the entire layer's content. It fades, pushes, or reveals layer content when animating. The stock transition effects can be extended by providing your own custom Core Image filters.

  • CAAnimationGroup allows an array of animation objects to be grouped together and run concurrently.

In addition to specifying the type of animation to perform, you must also specify the duration of the animation, the pacing (how the interpolated values are distributed across the duration), if the animation is to repeat and how many times, whether it should automatically reverse when each cycle is completed, and its visual state when the animation is completed. The animation classes and the CAMediaTiming protocol provides all this functionality and more.

CAAnimation and its subclasses and the timing protocols are shared by both Core Animation and the Cocoa Animation Proxy functionality. The classes are described in detail in Animation Types and Timing Programming Guide.