Step 1: Create a delegate for the UIViewController class:
@interface ViewController : UIViewController <UIScrollViewDelegate>
Step 2: add a delegate for your UIScrollView object:
scrollview.delegate = self;
Step 3: implements the delegation methods as follows:
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
Here you go. Using the above three steps, you can integrate the ScrollViewDidScroll method into our Objective-C class.
source share