Pop是一个适用于iOS和OS X平台的可扩展动画引擎,由facebook开源的。
主要分为四个功能。
1.基本的静态动画
2.spring动画
3.decay动画
4.自定义动画
基本动画
1
2
3
4
5
| POPBasicAnimation *anim = [POPBasicAnimation animationWithPropertyNamed:kPOPViewAlpha];
anim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; //过渡动画直接使用系统的参数
anim.fromValue = @(0.0);
anim.toValue = @(1.0);
[view pop_addAnimation:anim forKey:@"slide"];
|
spring
1
2
3
| POPSpringAnimation *anim = [POPSpringAnimation animationWithPropertyNamed:kPOPLayerBounds];
anim.toValue = [NSValue valueWithCGRec t:CGRectMake(0, 0, 400, 400)];
[layer pop_addAnimation:anim forKey:@"size"];
|
decay
1
2
3
| POPDecayAnimation *anim = [POPDecayAnimation animationWithPropertyNamed:kPOPLayerPositionX];
anim.velocity = @(1000.);
[layer pop_addAnimation:anim forKey:@"slide"];
|
原文链接http://www.cocoachina.com/applenews/devnews/2014/0429/8265.html