TextureGroup / Texture

Smooth asynchronous user interfaces for iOS apps.
https://texturegroup.org/
Other
8.03k stars 1.3k forks source link

Replace UICollectionViewLayout Subclassing with ASDK-Synced Layout Object #167

Open garrettmoon opened 7 years ago

garrettmoon commented 7 years ago

From @Adlai-Holler on December 15, 2016 20:1

Right now the user subclasses UICollectionViewLayout and talks directly to the collection view. This brings a number of issues:

I've thought through the requirements a bit, I'll add them into this task later.

Copied from original issue: facebookarchive/AsyncDisplayKit#2780

hovox commented 7 years ago

Hi.

We want to create a mosaic layout, like the Pinterest's feed. The problem is that cells have different heights, and height calculation should be done in the node automatically by layout engine.

In current implementation as I understand, We have to measure all nodes in advance, even if the layout doesn't care!, but how to do that ? Should we get all nodes in UICollectionViewLayout's subclass, and somehow request their calculated height ?

nguyenhuy commented 7 years ago

@hovox We have a sample project that does exactly that: https://github.com/TextureGroup/Texture/tree/master/examples/CustomCollectionView.

For further questions, please ask the folks on the #general channel of Texture Slack or post on StackOverflow to get help. Cheers!

hovox commented 7 years ago

Thanks @nguyenhuy. I saw that example, will look closer into it.

billdinh commented 5 years ago

https://github.com/TextureGroup/Texture/tree/master/examples/CustomCollectionView

@nguyenhuy This example is good demonstration for offline images. Can you please give me another example of how to implement Pinterest layout with network images? Thank you.