[翻译] 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 ...
随机推荐
- hibernate基本配置show_sql、sql_format
show_sql是否打印生成的sql语句: <property name="show_sql">false</property> sql_format,格式 ...
- Tomcat服务器安装配置
1.到http://tomcat.apache.org/官网下载Tomcat的zip版本,这样直接解压就行了,不用安装.我下载是Tomcat6.0版本的zip文件,解压在D:\Java\apache- ...
- golang reflect包使用解析
golang reflect包使用解析 参考 Go反射编码 2个重要的类型 Type Value 其中Type是interface类型,Value是struct类型,意识到这一点很重要 Type和Va ...
- *2.3.3-加入monitor
验证平台必须监测DUT的行为,只有知道DUT的输入输出信号变化之后,才能根据这些信号变化来判定DUT的行为是否正确. 验证平台中实现监测DUT行为的组件是monitor.driver负责把transa ...
- CUBA与Spring相比,有很大的不同吗?
原文:Developing with CUBA - a big shift from Spring? 翻译:CUBA China CUBA-Platform 官网 : https://www.cuba ...
- nginx 配置 单页面应用的解决方案
server { listen 80; server_name example.com; root /var/www/example.com; gzip_static on; location / ...
- 百度开源e-chart初探
前言: 近年来,在数据服务的公司中,数据可视化越来越重要.随着而来的,国内外正在如火如荼的开发各种在线js视图展示框架.而百度的e-chart算是实用性较高且体验最好的!今天闲来无事,便来玩玩~ ec ...
- 【angular5项目积累总结】http请求服务封装
http.provider.ts import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/co ...
- SSIS教程:创建简单的ETL包 -- 6. 对项目部署模型使用参数(Using Parameters with the Project Deployment Model)
在本课中,将修改在第 5 课: 添加包部署模型的包配置中创建的包,以便使用项目部署模型.您将使用一个参数替换该配置值,以便指定示例数据位置.还可以复制本教程附带的已完成的 Lesson 5 包. 使用 ...
- 【总】java面试题
100+经典Java面试题及答案解析 https://www.cnblogs.com/pureEve/p/6546280.html 2017 最新java面试题(技术面试) https://blog. ...