scrollViewDidEndDecelerating detect which collection view in action
Asked Answered
D

1

7

I use this method to organize paging:

- scrollViewDidEndDecelerating

When I scroll my UICollectionView I change some content on my screen. But I have few UICollectionView on my screen and I need it just for one.

Drummer answered 22/11, 2013 at 16:1 Comment(0)
P
24

Well, UICollectionView inherits from UIScrollView, so you could just check which scroll view did end decelerating from within the delegate method.

- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
{
    if (scrollView == collectionViewOne) {

    }else if (scrollView == collectionViewTwo) {

    }else{
            //something else
    }
}
Prerogative answered 22/11, 2013 at 16:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.