Saturday, 24 August 2013

Pass scrollview delegate to child view controller

Pass scrollview delegate to child view controller

I cant seem to figure out how to set a scrollview's delegate as a
viewcontroller within the scrollview.
ChildView *child = [[ChildView alloc] init];
_scrollview.delegate = child;
My child view controller is using the scrollview delegate:
@interface ChildView : UIViewController <UIScrollViewDelegate>
But it won't call scrollViewDidScroll;
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
NSLog(@"%f", scrollView.contentOffset.y);
}
Basically, I would like the scrollview offset of a scrollview to be passed
to a view controller nested within it.

No comments:

Post a Comment