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.

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容

  • JSP 有以下三類標簽: 指令:JSP Directive 指令標簽用于設置與整個 JSP 頁面相關的屬性,非常常...
    胖先森閱讀 224評論 0 2
  • 姓名:鄭文華 公司:寧波大發化纖有限公司 《六項精進》289期學員 【日精進打卡第10天】 【知~學習】 《六項精...
    13c78e1e6538閱讀 179評論 0 0
  • 你還得再瀝些風雨, 直到你把來時的顛沛權當時間流逝, 不再提。
    我的晴天借你閱讀 198評論 0 1
  • 似乎,正式步入大學軌道后的我們便有了更大的空間和更多可以任由我們肆無忌憚地去嘗試的機會,并為之而投入心血。但是同時...
    梭子梭子閱讀 311評論 0 0
  • 初中,高中,都遇到很多的人同學,新朋友,然而有多少人是真的發自內心的對待過你! 每當我們跟一個人熟了你覺得你們已經...
    虐Xin閱讀 231評論 0 0