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

[ASCollectionView] Pass the Cell Node Through in willDisplayNode: Delegate Method #2282

Merged
merged 1 commit into from
Sep 23, 2016

Conversation

Adlai-Holler
Copy link
Contributor

This addresses cases where users are calling waitUntilAllUpdatesAreCommitted during this callback in order to get the cell node. This practice is unsafe, because you may be editing a collection view while the collection view is calling back to you.

Ready for review @maicki @appleguy @hannahmbanana!

Copy link
Contributor

@garrettmoon garrettmoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

* passed into this method may not correspond to the same item in your data source
* if your data source has been updated since the last edit was processed.
*
* This method is deprecated. Use @c collectionView:willDisplayNode:forItemAtIndexPath: instead.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is @c here?

@@ -403,6 +404,10 @@ NS_ASSUME_NONNULL_BEGIN
* @param tableView The sender.
* @param node The node which was removed from the view hierarchy.
* @param indexPath The index path at which the node was located before the removal.
*
* @warning AsyncDisplayKit processes table view edits asynchronously. The index path
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish there was something we could do to really emphasize this…

* passed into this method may not correspond to the same item in your data source
* if your data source has been updated since the last edit was processed.
*
* This method is deprecated. Use @c tableView:willDisplayNode:forRowAtIndexPath: instead.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is @c ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That means "print the next word in monospaced font" http://blog.dadabeatnik.com/2013/09/25/comment-docs-in-xcode-5/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, huh, neat!

@hannahmbanana
Copy link
Contributor

Let me know when this gets merged to master and I'll bring it to 6.12

@Adlai-Holler Adlai-Holler merged commit 4326fc9 into master Sep 23, 2016
@Adlai-Holler Adlai-Holler deleted the AHWillDisplayNode branch September 23, 2016 23:50
@Adlai-Holler
Copy link
Contributor Author

Thanks @garrettmoon for reviewing!

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.

3 participants