Iglistkit: Can IGListKit be used with AsyncDisplayKit?

Created on 19 Oct 2016  路  2Comments  路  Source: Instagram/IGListKit

Can IGListKit be used with AsyncDisplayKit
https://github.com/facebook/AsyncDisplayKit

question

Most helpful comment

@modLX4 great question, and absolutely yes it can! In fact, I'm planning on adding an example using ComponentKit, AsyncDisplayKit, UIKit, and even WKWebView all within the same list. IMO that's the power of what we're using.

Now to use this with AsyncDisplayKit there are a few caveats:

  • You cannot use ASCollectionView

    • Instead, you will create a standard IGListCollectionView + IGListAdapter and your own section controllers

  • Use UICollectionView subclasses that use their own ASDisplayNodes internally
  • The only tricky part is responding to async sizing

    • Within your section controller you could call self.collectionContext?.reloadSectionController(self) to reload everything when the sizing is finished

    • You can also make sizing synchronous but do async display

There's no best-practice for this yet until we try it though.

All 2 comments

@modLX4 great question, and absolutely yes it can! In fact, I'm planning on adding an example using ComponentKit, AsyncDisplayKit, UIKit, and even WKWebView all within the same list. IMO that's the power of what we're using.

Now to use this with AsyncDisplayKit there are a few caveats:

  • You cannot use ASCollectionView

    • Instead, you will create a standard IGListCollectionView + IGListAdapter and your own section controllers

  • Use UICollectionView subclasses that use their own ASDisplayNodes internally
  • The only tricky part is responding to async sizing

    • Within your section controller you could call self.collectionContext?.reloadSectionController(self) to reload everything when the sizing is finished

    • You can also make sizing synchronous but do async display

There's no best-practice for this yet until we try it though.

馃帀

Let's track that work at #94 馃憤

Was this page helpful?
0 / 5 - 0 ratings