AsyncDisplayKit icon indicating copy to clipboard operation
AsyncDisplayKit copied to clipboard

Provide an ASCollectionView

Open graouts opened this issue 12 years ago • 8 comments

In the same way that ASTableView is a UITableView subclass that integrates node-based cells and a working range, a UICollectionView subclass that benefits form the advances made by ASDK would be fantastic.

graouts avatar Oct 16 '14 10:10 graouts

This would work very nicely, and ASRangeController was designed to support it with a few tweaks. However, we don't have a good read on how many developers use UICollectionView, and won't have resources to start this in the next month (probably anytime in 2014 due to holidays).

Contributions in this area would be incredibly valuable! We'll keep this task open until it's done.

appleguy avatar Oct 16 '14 16:10 appleguy

I would love the addition of ASCollectionView as the amount of efficiency would be great. I was under the impression that Paper significantly used UICollectionViews to render stories. Nonetheless, this would be great.

kartikthapar avatar Oct 17 '14 18:10 kartikthapar

+1 :]

rainypixels avatar Oct 19 '14 02:10 rainypixels

For historical and miscellaneous reasons, paper uses a custom implementation of scrolling akin to, but not based on, UICollectionView for its feed. So, the API we've been building here is for the convenience of adopting our async apis rather than just open-sourcing something we have built already. We started with table views since that seemed to be the most obvious thing. You could of course make your own UICollectionView-based API by computing a set of nodes to pre-load based on the layout. We'd be interested in hearing your use case and whether the cells are changing positions frequently or you're scrolling through a mostly static feed of cells. One of the challenges in paper was handling the correct insertion of cards into the strip, but, since they are all the same width, the computations do not require sizing the nodes. If your layout has a variable size of each card, you would need to do more work to guess which nodes actually need creation and sizing based in the particulars of your layout scheme.

Thanks for your suggestions.

Le Oct 19, 2014 à 03:32, rainypixels [email protected] a écrit :

+1 :]

— Reply to this email directly or view it on GitHub.

darknoon avatar Oct 19 '14 13:10 darknoon

@darknoon

We'd be interested in hearing your use case and whether the cells are changing positions frequently or you're scrolling through a mostly static feed of cells.

In my case, I don't care so much for changing the position (I'm assuming you're talking about indexPath) of cells once they've been laid out. I'm more interested in being able to provide custom layouts (specifically, horizontal) and the ability to have variable-sized cells in that layout. Some equivalent of layoutAttributesForElementInRect:, layoutAttributesForItemAtIndexPath:, and targetContentOffsetForProposedContentOffset: would be great as well as those would let me do a few interesting things to a horizontal layout. A collectionView layout that looks like the Paper strip, but allows for items of different heights (center-aligned) would be a good example of what would meet my needs.

As a side note, probably my favorite feature of AsyncDisplayKit is that nodes calculate their own sizes. I've been working on enabling iOS8 self-sizing cells into my existing UICollectionViews and UITableViews, and those features seem to be tremendously buggy right now (first of three radars I have on my list to file).

Thanks to you and team for open sourcing this framework. It's truly awesome (and necessary).

rainypixels avatar Oct 20 '14 01:10 rainypixels

Working on a big project that would love ASCollectionView (this is me putting my vote forward). The ASTableview would normally work, but my table view goes from a vertical scroll (all the same sized cells) to then transition into a horizontal scroll (the cells are the same ratio, but 70% the size), so a CollectionView is best for the transition.

Morgan-Kennedy avatar Oct 20 '14 04:10 Morgan-Kennedy

+1 As UICollectionView is definitely the future of table views, I personally try to use them every time. I think this is mandatory for this awesome framework :)

macistador avatar Oct 26 '14 11:10 macistador

This is now in master, and will be getting editing / update support at the same time as ASTableView. Closing. =]

secretiverhyme avatar Dec 04 '14 01:12 secretiverhyme