Westley
Westley

Reputation: 1153

Can I use UICollectionView to render sub-sections within sections?

I've been digging around for quite a while (including an hour with ChatGPT) to try and figure out a way to achieve this UI using UICollectionView:

enter image description here

The iOS dev in me who has been doing this for 10+ years thinks that UICollectionView might not be capable of handling this kind of layout (sections within sections). But admittedly I am not up to speed on everything it can do. It looks like the compositional layout is designed to support something like this, but I can't figure out how to tie it all together. Ideally the section and sub-section headers would stick to the top as you scroll, but that isn't a deal breaker.

The existing code I am refactoring uses UICollectionView so I would prefer that out of convenience, but if there is a better way to achieve this I am open to it. TableViews inside of collectionView cells? A stackView of collectionViews? :grimacing: I am stumped.

Upvotes: 1

Views: 98

Answers (0)

Related Questions