How to tell if UICollectionView header has been scrolled?

75 Views Asked by At

Alright, I am trying to mimic the effect on this website where the header is sticky, but it animates from big to small (with typed text on the smaller version) once the header has been scrolled out of sight.

Header model here.

My collection is created programmatically, and this makes the header sticky:

 let layout = collectionView.collectionViewLayout as? UICollectionViewFlowLayout 
        layout?.sectionHeadersPinToVisibleBounds = true

But, is there a way to determine if user has scrolled past where the header originally was, and then animate from there?

I know how to change the height after that.

0

There are 0 best solutions below