iOS: UIScrollView detecting Swipe Gesture
10,489
UIScrolViewDelegate has a method to detect when the user "began" dragging:
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
{
// disable timer here
}
Author by
Bins Ich
Updated on June 04, 2022Comments
-
Bins Ich almost 2 years
I have an UIScrollView which scrolls automatically by using a timer, which scrolls every 3 seconds to the next page (kind of slideshow).
Now I want to implement a function which detects any user interaction, to cancel the timer as soon as the user interacts with the scrollview, so that he can scroll through the scrollview by himself.
What would be the best way to do this? The ScrollView isn't subclassed and is using the UIScrollViewDelegate.
Would be glad for some hints. Cheers.