IOS: ScrollView delegate method inside CollectionView does not call

First I set the delegate to the .h file

@interface ViewController : UIViewController<UICollectionViewDataSource, UIScrollViewDelegate> 

After that, just call this method in the collection file .m file

 - (void)scrollViewDidScroll:(UIScrollView *)scrollView { NSLog(@"scrollViewDidScroll"); } 

but do not call this method.

+5
source share
1 answer

Just make it simple

yourCollectionView.delegate = i;

and add uicollectionviewdelegate

remove UIScrollViewDelegate

+3
source

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


All Articles