EasingAnimation

https://github.com/YouXianMing/EasingAnimation

This class is used for Easing animation.

  • Easy to understand
  • You can use it to build your own animation

How to use

  • Import the header

    and use like this:

 // 计算好起始值,结束值
CGFloat oldValue = 0.f;
CGFloat newValue = 1.f; // 关键帧动画
CAKeyframeAnimation *animation = \
[CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.z"]; // 设置值
[animation setValues:[YXEasing calculateFrameFromValue:oldValue
toValue:newValue
func:ElasticEaseOut
frameCount:500]]; // 设置持续时间
animation.duration = 0.5f; // 每秒增加的角度(设定结果值,在提交动画之前执行)
layer.transform = \
CATransform3DMakeRotation(newValue, 0.0, 0.0, 1.0); // 提交动画
[layer addAnimation:animation forKey:nil];

enjoy it :)

EasingAnimation的更多相关文章

  1. Swift - EasingAnimation绘制圆环动画

    Swift - EasingAnimation绘制圆环动画 效果 源码 https://github.com/YouXianMing/Swift-Animations // // CircleView ...

  2. 再谈CAAnimation动画

    CAAnimaton动画分为CABasicAnimation & CAKeyframeAnimation CABasicAnimation动画, 顾名思义就是最基本的动画, 老规矩先上代码: ...

  3. 背水一战 Windows 10 (15) - 动画: 缓动动画

    [源码下载] 背水一战 Windows 10 (15) - 动画: 缓动动画 作者:webabcd 介绍背水一战 Windows 10 之 动画 缓动动画 - easing 示例演示缓动(easing ...

  4. iOS基本动画/关键帧动画/利用缓动函数实现物理动画效果

    先说下基本动画部分 基本动画部分比较简单, 但能实现的动画效果也很局限 使用方法大致为: #1. 创建原始UI或者画面 #2. 创建CABasicAnimation实例, 并设置keypart/dur ...

  5. 重新想象 Windows 8 Store Apps (19) - 动画: 线性动画, 关键帧动画, 缓动动画

    原文:重新想象 Windows 8 Store Apps (19) - 动画: 线性动画, 关键帧动画, 缓动动画 [源码下载] 重新想象 Windows 8 Store Apps (19) - 动画 ...

  6. 用Easing函数实现碰撞效果

    用Easing函数实现碰撞效果 工程中需要的源码请从这里下载: https://github.com/YouXianMing/EasingAnimation 源码: // // ViewControl ...

随机推荐

  1. flot中文详解

    调用plot函数的方法如下: var plot = $.plot(placeholder, data, options) Data的结构: data应该是data series的一个数组: [ ser ...

  2. GitHub注册和Git安装

    一.注册GitHub GitHub官方地址:https://github.com. 在浏览器中打开GitHub网址,通过首页进行注册,如下图所示. 二.安装Git Git官方下载地址:http://g ...

  3. PHP之string之str_pad()函数使用

    str_pad (PHP 4 >= 4.0.1, PHP 5, PHP 7) str_pad - Pad a string to a certain length with another st ...

  4. multi-threads JavaEE 容器

    Thread -- Request What is recommended way for spawning threads from a servlet in Tomcat [duplicate] ...

  5. [作业] Python入门基础--猜年龄

    age = 20 while True: try: guess_age = int(input('guess age:')) if guess_age > age: print('Is bigg ...

  6. PHP OOP面向对象部分方法归总(代码实例子)

    <?php//对象名存在栈内存中,数据存在堆内存中class leyangjun{    var $name;  //定义变量    var $age;    var $sex;         ...

  7. Android组件--意图(Intent)

    1. 隐示调用和显示调用 参考资料:http://blog.csdn.net/harvic880925/article/details/38399723 1.概念 1). 显式意图: 能从intent ...

  8. 联想G480安装固态硬盘过程

    联想G480安装固态硬盘过程  百度上面图文并茂: https://jingyan.baidu.com/article/e2284b2b68eaf6e2e6118de1.html

  9. c# 旋转图片 无GDI+一般性错误

    using (System.Drawing.Bitmap backgroudImg = System.Drawing.Bitmap.FromFile(DoubleClickPicInfo.FileNa ...

  10. [FORWARD]ODBC 各种数据库连接串

    Overview Generally, one of the first steps when you are trying to work with databases is open it. Yo ...