MichiganLabs / AnimatingTableViewHeader

A Swift project explaining how to animate a header above a UITableView
164 stars 35 forks source link

Take extra margin into account when calculating absoluteBottom #9

Closed tfe closed 3 years ago

tfe commented 3 years ago

Take layout margins and content inset into account when calculating absoluteBottom.

Without adding these adjustments back in, when scrolling up the animation will appear to start late, i.e. you need to scroll up a number of pixels equal to the height of the bottom margin and content inset before the header starts to uncollapse.

See details on #8. Fixes #8.

tfe commented 3 years ago

I'm not actually certain this is correct anymore... plus I used the wrong variable name (collectionView from my use case, not scrollView which is what the original uses).