CHAnimation動(dòng)畫引擎編寫演示
CHAnimation 用來演示如何編寫自己的動(dòng)畫引擎,靈感來自于 Facebook Pop,只需 600 行的 Objective-C 代碼。
使用方法:
#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"];評(píng)論
圖片
表情
