facebookarchive / AsyncDisplayKit

Smooth asynchronous user interfaces for iOS apps.

Home Page:http://asyncdisplaykit.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[RFC] New API to perform a block after collection/table view finished committing all updates

nguyenhuy opened this issue · comments

It's a common need for users to perform certain tasks after a collection/table view finishes loading its initial data, for example to scroll to a certain item (#3048) or hide a loading indicator. Currently it's quite difficult to achieve this. Users have to either block main until all updates are committed, or trigger the initial data load themselves via -performBatchUpdateWithCompletion:.

It would be more user-friendly if we provide a block-based API, say -performBlockAfterAllUpdatesAreCommitted:, that users can call to schedule a block containing all the operations they need to run.

This API should be provided only by ASCollectionNode and ASTableNode and not their view counterparts. The reason is that users can call it as soon as they want, even before the backing view is allocated. The provided block should still be correctly retained and performed later.

Love this idea @nguyenhuy! This would be super useful for loading indicator footers etc. 👍

This issue was moved to TextureGroup/Texture#219