views:

581

answers:

1

hello,

My UIScrollView has a strange behaviour. A view controller is a delegate of my UIScroll, during scroll I receive scrollViewDidScroll and scrollViewDidEndScrollingAnimation. All is working. But when the scroll view bounces, I no more receive scrollViewDidEndScrollingAnimation but still receiving scrollViewDidScroll...

Do you have an idea ?

Thanks a lot.

Thierry

A: 

It behaves in a similar way when zooming. I've fixed it in my ZoomScrollView component by setting up a timer. The following should work for you:

- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
    [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(_zoomDidEndBouncing) object:nil];
    [self performSelector:@selector(_zoomDidEndBouncing) withObject:nil afterDelay:0.1];
}

- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView {
    [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(_zoomDidEndBouncing) object:nil];
    [self performSelector:@selector(_zoomDidEndBouncing) withObject:nil afterDelay:0.1];
}
Andrey Tarantsov