[翻译] AsyncDisplayKit
AsyncDisplayKit


AsyncDisplayKit is an iOS framework that keeps even the most complex user interfaces smooth and responsive. It was originally built to make Facebook's Paper possible, and goes hand-in-hand with pop's physics-based animations — but it's just as powerful with UIKit Dynamics and conventional app designs.
AsyncDisplayKit(异步图形显示)是一个iOS的开源框架,它能改善非常复杂的用户交互卡顿的问题,并使其圆滑。最开始,开发它是用来优化Facebook的Paper应用,以及配合pop的物理引擎动画--当然,它像UIKit Dynamics框架一样高效且设计精美。
Quick start
ASDK is available on CocoaPods. Add the following to your Podfile:
ASDK可以通过CocoaPods安装,添加以下文件到Podfile中:
pod 'AsyncDisplayKit'
Import the framework header, or create an Objective-C bridging header if you're using Swift:
导入框架的头文件,或者创建Objective-C bridging header,如果你是使用Swift开发:
#import <AsyncDisplayKit/AsyncDisplayKit.h>
AsyncDisplayKit Nodes are a thread-safe abstraction layer over UIViews and CALayers:
AsyncDisplayKit的节点是一个线程安全的抽象layer,覆盖了UIView以及CALayer

You can construct entire node hierarchies in parallel, or instantiate and size a single node on a background thread — for example, you could do something like this in a UIViewController:
你可以通过封装的方式,或者是直接在子线程中实例化一个节点对象 -- 例如,你可以在UIViewController中做如下的操作:
dispatch_async(_backgroundQueue, ^{
ASTextNode *node = [[ASTextNode alloc] init];
node.attributedString = [[NSAttributedString alloc] initWithString:@"hello!"
attributes:nil];
[node measure:CGSizeMake(screenWidth, FLT_MAX)];
node.frame = (CGRect){ CGPointZero, node.calculatedSize };
// self.view isn't a node, so we can only use it on the main thread
dispatch_sync(dispatch_get_main_queue(), ^{
[self.view addSubview:node.view];
});
});
You can use ASImageNode and ASTextNode as drop-in replacements for UIImageView and UITextView, or create your own nodes to implement node hierarchies or custom drawing. ASTableView is a node-aware UITableView subclass that can asynchronously preload cell nodes without blocking the main thread.
你可以使用ASImageNode以及ASTextNode的继承类来替换UIImageView以及UITextView,或者创建你自己的节点,用以实现你自己的绘制方式,ASTableView就是一个自定义node的UITableView的子类,它可以异步装载cell节点而不阻塞主线程。
Learn more
- Read the Getting Started guide
- Get the sample projects
- Browse the API reference
- Watch the NSLondon talk
[翻译] AsyncDisplayKit的更多相关文章
- 《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 ...
随机推荐
- PHP加密解密数字,适用于URL加密。
本博主最近正在建设一个9元包邮的网站,希望各位光临指导一些意见: 9元包邮 http://www.jiubaou.com/ <?php /** * 加密解密类 * 该算法仅支持加密数字.比较适用 ...
- redis 数据库迁移
老大让把 一台机器上 redis 中所有的数据,迁移到另一台机器上 查了一下可以拷贝 rdb 文件, 此方法只适用于迁移到一个新的库, 迁移到正在使用的库就不行了, 而且 rdb 里面是所有的 db, ...
- WPF中Style文件引用另一个Style文件中的样式
第1种方法: 直接在当前Style文件(*.xaml)文件中使用: <ResourceDictionary.MergedDictionaries>来进行合并 <!-- 关键是注意so ...
- Oracle 12c JDBC 连接
import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import ...
- HighChart 体验之旅 (后台传递JSON参数和数据的方法)
转自:http://www.cnblogs.com/daviddai/archive/2013/04/12/Highchart.html 官网:http://www.highcharts.com/ 中 ...
- 开发一个 Windows 级别的操作系统难度有多大?
在搜索进程相关问题的时候,无意间看到了知乎上面的这个问题,这也是困惑我的问题,只是自己比较懒,没有刨根问底,这次无意间看到了,并且认真看了大神的回答,很受启发,作为记录,贴于此,与各位分享: 来源:知 ...
- linux和Android的Makefile和android.mk
1. makefile 1.1 gcc的参数 -Wall: 是打开警告开关, -O: 代表默认优化,可选:-O0不优化,-O1低级优化,-O2中级优化,-O3高级优化,-Os代码空间优化. -g ...
- [转] sqlserver 中查看trigger的disabled/enabled情况
本文转自:http://blog.csdn.net/miqi770/article/details/48708199 SELECT t.name AS TableName, tr.name AS Tr ...
- [转]C#进阶系列——WebApi 接口返回值不困惑:返回值类型详解
本文转自:http://www.cnblogs.com/landeanfen/p/5501487.html 阅读目录 一.void无返回值 二.IHttpActionResult 1.Json(T c ...
- c#创建window服务
Windows服务在Visual Studio 以前的版本中叫NT服务,在VS.net启用了新的名称.用Visual C# 创建Windows服务不是一件困难的事,本文就将指导你一步一步创建一个Win ...