CHAnimation动画引擎编写演示
CHAnimation 用来演示如何编写自己的动画引擎,灵感来自于 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"];
评论