[翻译] 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 ...
随机推荐
- 【ZooKeeper】单机伪集群搭建(适用于mac)
1.配置 .zookeeper下载地址:http://apache.mirrors.lucidnetworks.net/zookeeper/ 可以选择需要的版本,我下载的是zookeeper-3.4. ...
- 【Maven学习】maven-assembly-plugin的使用
转自http://liugang594.iteye.com/blog/2093607 maven-assembly-plugin使用描述(拷自 maven-assembly-plugin 主页) Th ...
- python-Condition 进程同步互斥
#!/usr/bin/python import multiprocessing,time def A(cond): name=multiprocessing.current_process().na ...
- 关系型数据库MySQL多实例
简介 MySQL数据库是一个中小型关系型数据库管理系统,软件开发者为瑞典MySQL AB公司.在2008年1月16号被Sun公司收购后Sun公司又被oracle公司收购.目前MySQL被广泛地应用在I ...
- MultipartFile的使用小结
Multipartfile转File?File转MultipartFile?可千万别转晕了. 题图:from Google 1. MultipartFile类型转File类型 想要将Multipart ...
- mysql去除重复记录案例
例1,表中有主键(可唯一标识的字段),且该字段为数字类型 1 测试数据 /* 表结构 */ DROP TABLE IF EXISTS `t1`; CREATE TABLE IF NOT EXISTS ...
- [译]用R语言做挖掘数据《一》
介绍 一.实验说明 1. 环境登录 无需密码自动登录,系统用户名shiyanlou,密码shiyanlou 2. 环境介绍 本实验环境采用带桌面的Ubuntu Linux环境,实验中会用到程序: 1. ...
- TextBox 控件
TextBox控件上有一个箭头,MultiLine属性,是多行显示 TextBox控件有System.Windows.TextBox类提供,提供了基本的文本输入和编辑功能 属性 A ...
- C# 之VS程序打包
VS2012没有自带打包工具,所以要先下载并安装一个打包工具.我采用微软提供的打包工具: InstallShield2015LimitedEdition.下载地址:http://pan.baidu. ...
- 【13】MD5编码、Zlib压缩解压缩
1.MD5加密 /// <summary> /// 使用MD5加密算法 /// </summary> /// <param name="md5MessageSt ...