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

Replace UICollectionViewLayout Subclassing with ASDK-Synced Layout Object #167

Open
garrettmoon opened this issue May 1, 2017 · 4 comments

Comments

@garrettmoon
Copy link
Member

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:

  • If the layout talks to the data source/delegate, it may be out-of-date while edit operations propagate through the data controller.
  • We can't know the layout for nodes until we insert them into the UICollectionView.
  • We have to measure all nodes in advance, even if the layout doesn't care!
  • It would be nice to do the layout off-main!

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

Copied from original issue: facebookarchive/AsyncDisplayKit#2780

@hovox
Copy link

hovox commented May 2, 2017

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
Copy link
Member

@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
Copy link

hovox commented May 2, 2017

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

@billdinh
Copy link

billdinh commented May 31, 2019

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.

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

No branches or pull requests

4 participants