2

I am trying to properly refresh an ASCollectionNode from Texture/AsyncDisplayKit whenever a user pulls down to refresh or decides to filter what they see.

By using Texture's shouldBatchFetch and willBeginBatchFetchWith delegate and setting the context for batch fetching to true, the ViewController is initially able to batch fetch and load data. Likewise, as the user scrolls down (pagination API) I am able to load more data and everything works properly.

However, when I want to set my data manager empty and try to restart the process after initializing the ASCollectionNode, the batch fetching context seems to stop working even if I set it to true. I have tried different methods to properly "reload data" but have not had success with Texture's asynchronous methods.

My failed attempts:

  • I tried using .reloadData() but read that it was highly inefficient for ASyncdisplaykit and was deprecated. After clearing my data, calling reload data, then setting my weNeedMoreContent to true, causes an index out of bounds error. Screenshot: reloadData Function

  • When the user refreshed, I tried deleting all the current rows and then setting the context for batch fetching to true but nothing would happen either.

If anyone has any working methods they use for refreshing their ASCollectionNode please let me know!

ASCollectionNode Delegate functions

Perform Batch Fetching and API helper functions

0 Answers0