Reputation: 21
I have a vertically scrolling collectionView where sections are scroll horizontally. How to know that section did end decelerating? If I use
func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
}
delegate just says me about vertical scrolling.
Upvotes: 2
Views: 652
Reputation: 390
If you are using Compositional Layout, you can achieve this kind of horizontal scroll logic via visibleItemsInvalidationHandler inside NSCollectionLayoutSection.
Like here:
sectionLayout.visibleItemsInvalidationHandler = { [weak self] items, contentOffset, environment in
// Here you can add some code to handle some kind of logic using contentOffset
}
Upvotes: 2