ScrollViewDidEndDecelerating detects what kind of view in action

I use this method to organize swap:

- scrollViewDidEndDecelerating 

When I view my UICollectionView , I change the contents on my screen. But I have few UICollectionViews on my screen, and I only need this for one.

+6
source share
1 answer

Well, a UICollectionView inherits from a UIScrollView, so you can just check which of the scrolling triggered the braking from the delegate method.

 - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView { if (scrollView == collectionViewOne) { }else if (scrollView == collectionViewTwo) { }else{ //something else } } 
+17
source

Source: https://habr.com/ru/post/958652/


All Articles