Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Conversation

appleguy
Copy link
Contributor

This provides features that allow clients to choose if they would prefer to block
on the completion of unfinished rendering, rather than allow a placeholder state to
become visible.

Internal-only features that facilitate the implementation of public API:
-[_ASAsyncTransaction waitUntilComplete]
-[ASDisplayNode recursivelyEnsureDisplay]

Also provided are two public APIs that are powered by those:
-[ASCellNode setNeverShowPlaceholders:], which integrates with both Tables and Collections
-[ASViewController setNeverShowPlaceholders:], which should work with Nav and Tab controllers.

Lastly, on ASDisplayNode, a new property .shouldBypassEnsureDisplay allows individual node types
to exempt themselves from blocking the main thread on their display. This is on by default for ASNetworkImageNode and ASMultiplexImageNode, for reasons explained in the comments.

By implementing the feature at the ASCellNode level rather than ASTableView & ASCollectionView,
developers can retain fine-grained control on display characteristics. For example, certain
cell types may be appropriate to display to the user with placeholders, whereas others may not.

The diff overall is extensively commented, including areas that were otherwise unchanged.

Essential follow-up work I have planned includes unit tests, revisiting names, and finalizing the header locations of definitions.

…t 2.0

This provides internal features on _ASAsyncTransaction and ASDisplayNode to facilitate
implementing public API that allows clients to choose if they would prefer to block
on the completion of unfinished rendering, rather than allow a placeholder state to
become visible.

The internal features are:
-[_ASAsyncTransaction waitUntilComplete]
-[ASDisplayNode recursivelyEnsureDisplay]

Also provided are two such implementations:
-[ASCellNode setNeverShowPlaceholders:], which integrates with both Tables and Collections
-[ASViewController setNeverShowPlaceholders:], which should work with Nav and Tab controllers.

Lastly, on ASDisplayNode, a new property .shouldBypassEnsureDisplay allows individual node types
to exempt themselves from blocking the main thread on their display.

By implementing the feature at the ASCellNode level rather than ASTableView & ASCollectionView,
developers can retain fine-grained control on display characteristics.  For example, certain
cell types may be appropriate to display to the user with placeholders, whereas others may not.

Follow-up work will include unit tests, revisiting names, and the header locations of definitions.
appleguy added a commit that referenced this pull request Sep 28, 2015
Implementation of Synchronous Concurrency features for AsyncDisplayKit 2.0
@appleguy appleguy merged commit c8518c7 into master Sep 28, 2015
@appleguy appleguy deleted the Synchrotron branch September 28, 2015 21:49
@appleguy
Copy link
Contributor Author

Feel free to share comments on this work, including API / naming ideas or feature requests!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants