I have a view controller with a UIScrollView embedded as a sub view. I embed it as follows:
CaptionViewController : UIViewController
Inside ViewDidLoad
scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 320, 320)];
scrollView.contentMode = (UIViewContentModeScaleAspectFit);
scrollView.contentSize = CGSizeMake(3200, 320);
scrollView.pagingEnabled = YES;
[self.view addSubview:scrollView];
Next I'm trying to wire up the scrollViewDidScroll event so I can execute some code each time the user swipes the scroll view. However, I can figure out how to access this event. I think the answer lies in delegation somehow. I tried importing UIScrollView.h and setting the scrollView delegate to the CaptionViewController as follows:
[scrollView setDelegate:self]
Still I cannot access scrollViewDidScroll. Can someone please point me in the right direction?