iOS : ScrollView delegate method inside of CollectionView not call

11,642

Just do simple

add below line in .m file

yourCollectionView.delegate = self;

and below add in .h

UICollectionViewDelegate

remove

UIScrollViewDelegate
Share:
11,642
vipinsaini0
Author by

vipinsaini0

I am primarily an iOS developer and 6.11 years of experience. Expertly-designed Apps, Attract and easy-to-use interface and use in daily routine. I worked on Apple SignIn, Socket, JSON-Parsing, Lottie-iOS, Audio-Video Calling and HTML games.

Updated on July 25, 2022

Comments

  • vipinsaini0
    vipinsaini0 almost 2 years

    First I have set delegate in .h file

    @interface ViewController : UIViewController<UICollectionViewDataSource, UIScrollViewDelegate>
    

    After that just call this method in collection view .m file

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

    but not call this method.