0
votes

I am building UICollectionView that needs to scroll vertically, but lay out its items in a columnar format in order to handle varying item heights, like this:

enter image description here

A column-by-column layout is the default for a horizontally-scrolling collection view, but mine needs to scroll vertically. What's the easiest way to accomplish this? Do I need to subclass UICollectionViewLayout, or can UICollectionViewFlowLayout do it? Or...?

1
You can achieve it using subclassing the UICollectionViewLayoutMidhun MP
There are tons of third party controls available that layout UICollectionView items the you want.Adeel

1 Answers

0
votes

Thanks for the comments. It turns out there is a subclass of UICollectionViewLayout called SelfSizingWaterfallCollectionViewLayout on github that does exactly what I needed.