Closed bmarkowitz closed 3 days ago
Noticed a small bug here where, because of line 87 in GridViewController, when you delete everything in the first or second section, the Planets section becomes a grid instead of horizontally scrolling.
I wonder if, similar to the flowLayoutDelegate, it makes sense to have something for comp layout exposed on the driver so that the layout can be more closely tied to the contents of the collection view without needing to maintain additional external state?
Fixed the above issue.
Hey thanks for doing this @bmarkowitz! ππΌ I'll try to take a look soon. π
As for introducing new model types, I have some ideas for this in #105 that we can discuss later. π
Can do! Does that mean we want a new tab, or did we want to repurpose an existing tab?
Can do! Does that mean we want a new tab, or did we want to repurpose an existing tab?
I think we can just modify the existing grid view! π
I'm imagining each section has 2 rows and scrolls horizontally.
each section has 2 rows and scrolls horizontally
@jessesquires dumb follow-up question:
Are you thinking we just have 2 identical rows, or are you hoping for the first row to snake into the 2nd?
dumb follow-up question:
Are you thinking we just have 2 identical rows, or are you hoping for the first row to snake into the 2nd?
Not a dumb question!
I'd like to have a layout like this screenshot, but:
See also:
https://lickability.com/blog/getting-started-with-uicollectionviewcompositionallayout/
Ah gotcha, that clarifies it! Sounds good!
@jessesquires Updated. Dang, I really did overthink the first approach, lol.
Updated. Dang, I really did overthink the first approach, lol.
Haha, it's all good!
This looks great! π Thanks so much for doing this. π―
Related to Issue #101
Describe your changes
As a newcomer to the library, I figured a good way to get my feet wet would be to try to add something to the Example app. As mentioned in the issue, we're looking for several new examples, including a horizontal section, so that's what I tried to do here.
To enable this, I essentially followed the example set by the Colors and People sections and added a new
PlanetModel
. Then, I added a horizontally scrolling section to the Grid tab's comp layout logic to display the 8 planets, as well as the accompanying cell view model mapping.At the end, I renamed the
GridColorCell
toBasicGridCell
as a way to just reuse the existing cell for both sections, but happy to just create a separate cell if that's preferred. Also, I'm not sure if the tab is best described asGrid
now that there's a non-grid section - let me know if we're prefer to rename that, have a new tab, etc.One other tweak I made was to have the supplementary views not follow the content insets of the section. This is super minor (happy to delete if we'd like), but I noticed that there was a tiny gap between the edge of the section headers and the edge of the screen, so this would address that. It's hard to show in a screenshot, but can be seen by looking closely in the sim.
Concerns
These are pre-existing things so I didn't investigate them much further, but I'm happy to create Issues for them to discuss them further.
Demo
https://github.com/user-attachments/assets/cfb235cf-dee6-42bc-b13b-400c00fc0068