Implemented a set of Custom Animation Libraries
Luo chaohui (http://blog.csdn.net/kesalin)
Reprinted please indicate the source
Recently, a set of Custom Animation libraries have been implemented on iOS, which can support automatic animation demonstration of values of any numeric variables and support a variety of animation effects. The effects are still dazzling. For example, if you set an offset variable from 50 to 100, this change can be done in an animation instead of a regular one-step approach. Compared with the animation library that comes with iOS, my custom animation library is more configurable and easier to use. Set indicates the set value of an animation, and update indicates the normal set value of no animation. Currently, the following animation types are supported:
Enum easetype _{
Easetype_none,
Easetype_in,
Easetype_out,
Easetype_inout,
};
Typedef int easetype;
Enum animationtype _{
Animationtype_linear,
Animationtype_bounce,
Animationtype_back,
Animationtype_quartic,
Animationtype_quintic,
Animationtype_circular,
Animationtype_cubic,
Animationtype_quadratic,
Animationtype_sinusoidal,
Animationtype_elastic,
};
Typedef int animationtype;
Example:
// setup animation // propertyValue.duration = duration; propertyValue.easeType = EaseType_Out; propertyValue.animationType = AnimationType_Back; // AnimationType_Elastic // AnimationType_Back // AnimationType_Bounce // start animation [propertyValue setValue:targetValue];
Rotate the pie graph with the rollback effect:
Rotation menu with bounce effect:
If you are free, sort out the Implementation ideas, write an article in detail, and release the source code.