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.

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀(guān)點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • JSP 有以下三類(lèi)標(biāo)簽: 指令:JSP Directive 指令標(biāo)簽用于設(shè)置與整個(gè) JSP 頁(yè)面相關(guān)的屬性,非常常...
    胖先森閱讀 253評(píng)論 0 2
  • 姓名:鄭文華 公司:寧波大發(fā)化纖有限公司 《六項(xiàng)精進(jìn)》289期學(xué)員 【日精進(jìn)打卡第10天】 【知~學(xué)習(xí)】 《六項(xiàng)精...
    13c78e1e6538閱讀 211評(píng)論 0 0
  • 你還得再瀝些風(fēng)雨, 直到你把來(lái)時(shí)的顛沛權(quán)當(dāng)時(shí)間流逝, 不再提。
    我的晴天借你閱讀 217評(píng)論 0 1
  • 似乎,正式步入大學(xué)軌道后的我們便有了更大的空間和更多可以任由我們肆無(wú)忌憚地去嘗試的機(jī)會(huì),并為之而投入心血。但是同時(shí)...
    梭子梭子閱讀 343評(píng)論 0 0
  • 初中,高中,都遇到很多的人同學(xué),新朋友,然而有多少人是真的發(fā)自?xún)?nèi)心的對(duì)待過(guò)你! 每當(dāng)我們跟一個(gè)人熟了你覺(jué)得你們已經(jīng)...
    虐Xin閱讀 247評(píng)論 0 0

友情鏈接更多精彩內(nèi)容