I have a UIScrollView under a transparent UIView. I need to transfer all pans and taps to scroll mode (which scrolls horizontally only). A regular UIView uses a subclass of UIPanGestureRecognizer to track vertical brackets ( Subclass found here ). In the overlay view, I override the touch event methods to pass them to the UIScrollView.
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { [super touchesBegan:touches withEvent:event]; [self.scrollView.panGestureRecognizer touchesBegan:touches withEvent:event]; [self.scrollView.singleTapGesture touchesBegan:touches withEvent:event]; } - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event { [super touchesCancelled:touches withEvent:event]; [self.scrollView.panGestureRecognizer touchesCancelled:touches withEvent:event]; [self.scrollView.singleTapGesture touchesCancelled:touches withEvent:event]; } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { [super touchesEnded:touches withEvent:event]; [self.scrollView.panGestureRecognizer touchesEnded:touches withEvent:event]; [self.scrollView.singleTapGesture touchesEnded:touches withEvent:event]; } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { [super touchesMoved:touches withEvent:event]; [self.scrollView.panGestureRecognizer touchesMoved:touches withEvent:event]; [self.scrollView.singleTapGesture touchesMoved:touches withEvent:event]; }
Overlay view, vertical panorama works fine. In UIScrollView, cranes also work just fine. Scrolling though, not so much. The scroll view scrolls about three points and then stops (as the horizontal pan continues). If I let go of the speed, the scroll view then raises that speed and ends the scroll.
What are the possible problems causing a scroll view to stop scrolling and then get speed?
Brandon mqq
source share