Skip to content
Projets

À propos

CHAnimation is a project used to demonstrate how to write your own animation engine, inspired by Facebook Pop.

Design et médias

Comment ces chiffres sont mesurés

Progression mesurée des étoiles

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
Historique en cours

Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.

README.md

Original

CHAnimation

CHAnimation is a project used to demonstrate how to write your own animation engine, inspired by Facebook Pop, with only 600 lines of Objective-C you can understand.

You can also use this project to help learning Facebook Pop.

Requirements

CHAnimation requires Xcode 5, targeting either iOS 5.0 and above, ARC-enabled.

Types

Unlike Facebook Pop, CHAnimation supports only one animation type, that is linear animation. The main purpose of this project is to help developer understand how an animation engine works, so I tried my best to keep the code small and clean. I think if you finished reading the code of CHAnimation, you can add more timingFunction as you want.

Currently, CHAnimation supports CGSize, CGPoint and NSNumber as animated values, you can add more types if you want.

How to use

CHAnimation adopts the Core Animation explicit animation programming model, the interfaces are almost the same:

#import "CHAnimation.h"

CHAnimation *animation = [CHAnimation new];
animation.duration = 0.4;

animation.writeBlock = ^(id obj, id value) {
    button.center = [value CGPointValue];
};

animation.fromValue = [NSValue valueWithCGPoint:CGPointMake(70, 70)];
animation.toValue = [NSValue valueWithCGPoint:CGPointMake(170, 170)];

[button ch_addAnimation:animation forKey:@"animation"]; 

Resources

A collection of links to external resources may help you to understand the code:

How it looks

![CHAnimation] (https://raw.github.com/cyndibaby905/CHAnimation/master/CHAnimation.gif)

Lincense

CHAnimation is available under the MIT license. See the LICENSE file for more info.

Explorer des projets similaires

Chargement…