Asyncdisplaykit Official document reading 1

why our app is lag?

iOS device screen fps(frame per seconds) is 60hz,it means app must keep fps no less than 60 to avoid app leg,if the fps under 60,we will see the image is not continued and become not smooth,some people may ask a problem how can we get the system response callback.the system provide a method called CADisplayLink,and execute it every 16 milliseconds,we can use it in executing all layout and drawing code.

tips:

if our app is busy in other things,system may skip calling the method.maybe it is the reason why we should not put some things in main thread.

http://asyncdisplaykit.org/docs/getting-started.html

asyncdiplaykit replace the majority of uikit with node,Of course, you can always access the underlying view or layer directly via node.view or node.layer, just make sure to do it on the main thread!

Core Concepts

it main includes several facts as follow:

1.Intelligent Preloading

its main work principle.why asyncdisplaykit can give user interface interactive so good.

It has three interface state.preload,display and visible, we can see them in above picture. As a user scrolls, nodes move through the ranges and react appropriately by loading data, rendering, etc. Your own node subclassescan easily tap into this mechanism by implementing the corresponding callback methods.

Visible Range

-didEnterVisibleState

-didExitVisibleState

Display Range

-didEnterDisplayState

-didExitDisplayState

Preload Range

-didEnterPreloadState

-didExitPreloadState

Node Containers

Every node has its node containers.The advantage of node containers is it can provide many methods for us,help us save time.

What do I Gain by Using a Node Container?

A node container automatically manages the intelligent preloading of its nodes. This means that all of the node’s layout measurement, data fetching, decoding and rendering will be done asynchronously. Among other conveniences, this is why it is recommended to use nodes within a container node.

Note that while it is possible to use nodes directly (without an AsyncDisplayKit node container), unless you add additional calls, they will only start displaying once they come onscreen (as UIKit does). This can lead to performance degredation and flashing of content.

Node Subclasses

asyncdisplaykit.org/static/images/node-hierarchy.png

Nodes can offer more advanced features and conveniences.For example, an ASNetworkImageNode does automatic loading and cache management, and even supports progressive jpeg and animated gifs.

http://asyncdisplaykit.org/docs/faq.html

This website offer some tips and solutions we need attention.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • JSP 有以下三类标签: 指令:JSP Directive 指令标签用于设置与整个 JSP 页面相关的属性,非常常...
    胖先森阅读 253评论 0 2
  • 姓名:郑文华 公司:宁波大发化纤有限公司 《六项精进》289期学员 【日精进打卡第10天】 【知~学习】 《六项精...
    13c78e1e6538阅读 211评论 0 0
  • 你还得再沥些风雨, 直到你把来时的颠沛权当时间流逝, 不再提。
    我的晴天借你阅读 217评论 0 1
  • 似乎,正式步入大学轨道后的我们便有了更大的空间和更多可以任由我们肆无忌惮地去尝试的机会,并为之而投入心血。但是同时...
    梭子梭子阅读 342评论 0 0
  • 初中,高中,都遇到很多的人同学,新朋友,然而有多少人是真的发自内心的对待过你! 每当我们跟一个人熟了你觉得你们已经...
    虐Xin阅读 247评论 0 0

友情链接更多精彩内容