Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add first-pass view model support to collection node. #trivial #356

Merged
merged 4 commits into from
Jun 12, 2017

Conversation

Adlai-Holler
Copy link
Member

@Adlai-Holler Adlai-Holler commented Jun 12, 2017

This is the first of a series of diffs I intend to land over the next couple of days, adding support for view-model backed cell nodes, and eventually optional view-model diffing to drive updates.

There's not much to this first pass. You can provide view models, and they'll get assigned to the cell node and made available by the collection node.

The next pass will add the idea of -canUpdateToViewModel: and skip fetching a new node block on reloadItemsAtIndexPaths: if the existing cell node can update.

I'll update the CHANGELOG when something more significant happens.

@@ -207,6 +207,7 @@ @interface ASCollectionView () <ASRangeControllerDataSource, ASRangeControllerDe
unsigned int collectionViewNumberOfItemsInSection:1;
unsigned int collectionNodeNodeForItem:1;
unsigned int collectionNodeNodeBlockForItem:1;
unsigned int viewModelForItem:1;
Copy link
Member Author

Choose a reason for hiding this comment

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

No prefix needed for this method, since there's no collectionNode/collectionView distinction this time.

@Adlai-Holler Adlai-Holler changed the title Add first-pass view model support to collection node. Add first-pass view model support to collection node. #trivial Jun 12, 2017
@ghost
Copy link

ghost commented Jun 12, 2017

🚫 CI failed with log

Copy link
Member

@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

*
* The view-model currently assigned to this node, if any.
*
* This property may be set off the main thread, but it will never be set in parallel.
Copy link
Member

Choose a reason for hiding this comment

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

Can you explain further what you mean "it will never be set in parallel"?

Copy link
Member

@nguyenhuy nguyenhuy left a comment

Choose a reason for hiding this comment

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

Instead of annotating the new APIs as beta, shouldn't they be declared in +Beta headers (e.g ASCellNode+Beta, ASCollectionNode+Beta, ASCollectionBetaDataSource, etc)?

@Adlai-Holler
Copy link
Member Author

@nguyenhuy For these changes I'd rather have smaller, simpler diffs and I don't see much drawback to it.

@Adlai-Holler Adlai-Holler merged commit 83111de into master Jun 12, 2017
@Adlai-Holler Adlai-Holler deleted the AHObjectsPass1 branch June 12, 2017 23:50
bernieperez pushed a commit to AtomTickets/Texture that referenced this pull request Apr 25, 2018
…reGroup#356)

* Add first-pass view model support for collection node. Much more to come!

* Address issues

* Update the gorram license header

* Dear lord
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants