I have a collection view with 3 sections, the first two sections work fine with UICollectionViewFlowLayout but the 3rd one needs a custom implementation.
I understand that a collection view can only have one layout, so I've been trying to only perform work in the overriden prepare function if I'm in the right section. This is where it tends to fall apart, I can't work out a straightforward way to figure out which section the cell is in which I'm calculating layout attributes for.
Not sure if there's a better approach than conditionally performing calculations in the prepare function either.
A point in the right direction would be great!