UIScrollView on scroll update method

Is there a way / ability to trigger a function on scroll scrolling?

i found scrolling start and scrolling end solutions, but nothing like onIsScrolling ...

Is there a built-in solution? or a better workaround (nstimer)?

thanks alex

+2


a source to share


2 answers


UIScrollViewDelegate

provides the following:

scrollViewDidScroll:scrollViewWillBeginDragging:scrollViewDidEndDragging:willDecelerate:scrollViewShouldScrollToTop:scrollViewDidScrollToTop:scrollViewWillBeginDecelerating:scrollViewDidEndDecelerating:

      



in particular:

– scrollViewDidScroll:

      

+4


a source


Thanks a lot for the scrollViewDidScroll tip. sample trial implementation:

@interface YourClass : UIViewController  <UIScrollViewDelegate>
{
    UIScrollView    *theView;
}

@end

      



in the .m file:

- (void)loadView 
{
    theView = [[UIScrollView alloc] initWithFrame:
CGRectMake(0, 10, 300, 300)];
    theView.delegate = self;

    [self.view addSubview:theView];

    theView.contentSize = CGSizeMake(500, 500); 
}

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

      

+2


a source







All Articles