Skip to content
프로젝트

소개

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

디자인 및 미디어

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

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.

관련 프로젝트 살펴보기

불러오는 중…