Group Group Group Group Group Group Group Group Group

raywenderlich.com Forums

AsyncDisplayKit 2.0 Tutorial: Getting Started

In this AsyncDisplayKit 2.0 tutorial, learn how to make your user interfaces scroll as smooth as butter through the power of asynchronous rendering.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/818-asyncdisplaykit-2-0-tutorial-getting-started

Such a shame ! I love swift, I hate staples, and AsyncDisplayKit seems to be the right solution to a huge number of my issues ! Anyway, you guys are doing an amazing job, and I’ll never say the contrary.

But when I start programming, I hesitated big time between swift and Objective C, and raywenderlich was the website that decided me. You guys have to continue the all-swift work !

I wish I could change between Swift and Obj-C code in RW tutorials. Anyway it’s great to know about AsyncDisplayKit! Thanks!

Hey guys, I’m planning on just creating Swift versions of this series so people can follow along with whichever language they prefer. I don’t have time to do it right now but let me know if something isn’t clear in the Swift examples!

There one problem on my iphone 5 device. Although it runs smoothly but when I scroll down and scroll up (to the top again), I expect the already loading cell should have no load time but seem like It always load in asyncdisplaykit.

I always see gray color without text and picture for the previous cells that are already loaded and later text and picture come. For picture, I understand that maybe because of the big picture my device is too slow. But how can normal text does not display instantly.

Is there a way to solve this?

I’m seeing the same issue with iPhone6+, using iOS10.2. Downloaded finished projects, built apps directly on to device with XCode 8.2.

  • Also the Swift version of project simply crashes shortly after launching.
  • ObjectiveC version of project needs a little bit scrolling and crashes eventually as well.
  • Tried the both versions (Swift and ObjectiveC) of the project, on iPhone7+, using iOS10.1.1. Scrolling seems to work in all four directions without any problems, no crashing, but gray area is still visible and not preloaded as expected and described in tutorial.

@sainttail @aged In the case of this sample app, the fact of the matter is that you’re probably going to see gray placeholders on older or slower devices. The images are way too large and the blur takes a long time. You could help things a lot just by having a server that returns images of the appropriate size and doing some other optimizations.

Another thing you can do is try setting neverShowPlaceholders to YES/true on the cellNodes. This should make it so you never see gray placeholders (even though the cells take a long time). The trade-off is that frames will be dropped while rendering is completed as new cells come on screen.

CGSize pagerNodeSize in AnimalPagerController.m is unused

Awesome tutorial, thanks guys!

However, I’m seeing a problem I don’t know how to solve. I’m using ASDK / Texture 2.3. I have an ASPagerNode that scrolls horizontally and that uses vertically-scrolling ASPagerNodes for each of its cells. It all works as you’d expect, with the exception of preloading. Each vertically-scrolling ASPagerNode receives the correct didEnterPreloadState, didEnterDisplayState, … notifications but it doesn’t pass them onto its children, including its first child, until the entire column of cells becomes visible. The user experience is such that if I scroll vertically within a given cell, the content preloads as expected. However, if I cross boundaries across the vertical columns of cells horizontally, the adjacent column of cells doesn’t begin loading until it becomes visible.

As a work-around, I’m intercepting the didEnter<foo>State notifications and manually pass them onto the ASPagerNode's children, but that seems like a kludgy solution. Any other ideas?

@hlavac Interesting, I’m hoping to find some time in the near future to update these two tutorials with all the updates that have happened in the last couple months so I’ll have to see if I can get this working again!

This tutorial is more than six months old so questions regarding it are no longer supported for the moment. We will update it as soon as possible. Thank you! :]