10

This is how I stick the sectionHeader to the top of collectionView when it scrolls

    (collectionView.collectionViewLayout as? UICollectionViewFlowLayout)?.sectionHeadersPinToVisibleBounds = true;

The problem is that, when the header hit a footer, it gets pushed up by the footer.

How do we make sure that a header can only be pushed up by another header?

Thank you

JayVDiyk
  • 6,250
  • 20
  • 61
  • 113

1 Answers1

0

Why don't you try creating one cell for the footer which will be a subclass of UICollectionViewCell and add it at the end of every section by adding 1 for number of rows for every section. then you will have a header which will not be pushed up by your footer

nishith Singh
  • 2,154
  • 1
  • 12
  • 22