[翻译] CHAnimation
CHAnimation

https://github.com/cyndibaby905/CHAnimation
How it looks

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.
CHAnimation是一个用来帮助你写你自己动画的引擎工具,受到了Facebook Pop的启发,只有600行的代码,你能够轻易的明白。
你也可以使用此工程来学习Facebook的Pop动画。
Requirements
CHAnimation requires Xcode 5, targeting either iOS 5.0 and above, ARC-enabled.
CHAnimation需要Xcode5,目标在iOS5.0以上,仅支持ARC。
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 moretimingFunction as you want.
Currently, CHAnimation supports CGSize, CGPoint and NSNumber as animated values, you can add more types if you want.
不像Facebook Pop动画支持动画的类型多,CHAnimation支持得动画类型是线性动画类型。这个项目的主要动机是帮助开发者理解动画引擎如何工作的,所以我尽最大的努力来保持代码轻量以及清晰。我相信,如果你读完了这个代码,你已经可以根据需要随意添加 timingFunction 方法了。
当前,CHAnimation支持CGSize,CGPoint以及NSNumber作为动画的values,你可以根据你的需要添加更多类型。
How to use
CHAnimation adopts the Core Animation explicit animation programming model, the interfaces are almost the same:
CHAnimation兼容Core Animation显式动画模型,这个使用接口基本上是一样的:
#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:
以下链接能帮助你理解这些代码:
- Apple – Core Animation Programming Guide
 - AGGeometryKit+POP - Animating Quadrilaterals with Pop
 - Facebook Pop – Extensible iOS and OS X animation library
 - Building Paper – Full Length Event
 
[翻译] CHAnimation的更多相关文章
- 《Django By Example》第五章 中文 翻译 (个人学习,渣翻)
		
书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者@ucag注:大家好,我是新来的翻译, ...
 - 《Django By Example》第四章 中文 翻译 (个人学习,渣翻)
		
书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:祝大家新年快乐,这次带来<D ...
 - [翻译]开发文档:android Bitmap的高效使用
		
内容概述 本文内容来自开发文档"Traning > Displaying Bitmaps Efficiently",包括大尺寸Bitmap的高效加载,图片的异步加载和数据缓存 ...
 - 【探索】机器指令翻译成 JavaScript
		
前言 前些时候研究脚本混淆时,打算先学一些「程序流程」相关的概念.为了不因太枯燥而放弃,决定想一个有趣的案例,可以边探索边学. 于是想了一个话题:尝试将机器指令 1:1 翻译 成 JavaScript ...
 - 《Django By Example》第三章 中文 翻译 (个人学习,渣翻)
		
书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:第三章滚烫出炉,大家请不要吐槽文中 ...
 - 《Django By Example》第二章 中文 翻译 (个人学习,渣翻)
		
书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:翻译完第一章后,发现翻译第二章的速 ...
 - 《Django By Example》第一章 中文 翻译 (个人学习,渣翻)
		
书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:本人目前在杭州某家互联网公司工作, ...
 - 【翻译】Awesome R资源大全中文版来了,全球最火的R工具包一网打尽,超过300+工具,还在等什么?
		
0.前言 虽然很早就知道R被微软收购,也很早知道R在统计分析处理方面很强大,开始一直没有行动过...直到 直到12月初在微软技术大会,看到我软的工程师演示R的使用,我就震惊了,然后最近在网上到处了解和 ...
 - ASP.NET MVC with Entity Framework and CSS一书翻译系列文章之第一章:创建基本的MVC Web站点
		
在这一章中,我们将学习如何使用基架快速搭建和运行一个简单的Microsoft ASP.NET MVC Web站点.在我们马上投入学习和编码之前,我们首先了解一些有关ASP.NET MVC和Entity ...
 
随机推荐
- JVM-垃圾收集过程的内存管理
			
JDK1.7 JVM的垃圾收集算法有 1. 标记-清除算法: 2. 复制算法:在商业虚拟机都是使用这种算法来回收新生代的 3. 标记-整理算法: 4.分代收集算法: JDK1.7 JVM的垃圾收集器有 ...
 - monitorenter与monitorexit指令
 - Types方法之isSameType-isSuperType-isSubType
			
4.isSameType() 方法 /** * Is t the same type as s? */ public boolean isSameType(Type t, Type s) { retu ...
 - 部署rails遇到问题
			
underfined method for has_attched_file when installing paperclip 解决 create the file paperclip.rb ins ...
 - box-shadow向元素添加阴影效果
			
div{ box-shadow: 10px 10px 5px #888888;} 语法:box-shadow: h-shadow v-shadow blur spread color inset; 值 ...
 - 从mdb到crash
			
本文面向使用过Solaris的mdb但是没有使用过Linux的crash的同学.比如说我自己,mdb用了很多年,现在全面转向Linux平台,于是很好奇Linux有没有类似的工具.熟悉Solaris的同 ...
 - hive-0.5.0安装出错
			
在安装过程中,第一次启动Hive没有成功,后来在网上查到原因如下,并成功解决: 错误如下: Exception in thread "main" java.lang.NoClass ...
 - 开始使用 Vuejs 2.0  ---简单总结1
			
Vue.js(读音 /vjuː/, 类似于 view) 是一套构建用户界面的 渐进式框架.与其他重量级框架不同的是,Vuejs 采用自底向上增量开发的设计.Vuejs 的核心库只关注视图层,并且非常容 ...
 - 问题集录--新手入门深度学习,选择TensorFlow 好吗?
			
新手入门深度学习,选择 TensorFlow 有哪些益处? 佟达:首先,对于新手来说,TensorFlow的环境配置包装得真心非常好.相较之下,安装Caffe要痛苦的多,如果还要再CUDA环境下配合O ...
 - C#图片验证码绘制
			
制作验证码.也可以画弧线之类..... //新建一个网站,在后台代码中引用一个using Stystem.Drawing的命名空间 Bitmap img = , ); //制作一个宽100,高50的画 ...