I have been trying to debug this for days with no luck.
Has anyone else seen this behaviour?
Did you override touches methods ?Because a scroll view has no scroll bars, it must know whether a touch signals an intent to scroll versus an intent to track a subview in the content. To make this determination, it temporarily intercepts a touch-down event by starting a timer and, before the timer fires, seeing if the touching finger makes any movement. If the timer fires without a significant change in position, the scroll view sends tracking events to the touched subview of the content view. If the user then drags their finger far enough before the timer elapses, the scroll view cancels any tracking in the subview and performs the scrolling itself. Subclasses can override the touchesShouldBegin(_:with:in:), isPagingEnabled, and touchesShouldCancel(in:) methods (which are called by the scroll view) to affect how the scroll view handles scrolling gestures.
note that it's just a simulator, may not react exactly as a real device.
Check the mouse and trackpad settings in System preferences.
Code Block self.panGestureRecognizer.addTarget(self, action: #selector(handleScrollGesture(_:)))
Code Block @objc func handleScrollGesture(_ recognizer: UIGestureRecognizer) { guard recognizer.view != nil else { return } switch recognizer.state { case .possible : print("Scroll possible") case .began : print("Scroll began") case .recognized : print("Scroll recognized") case .changed : print("Scroll changed") case .cancelled: print("Scroll Cancelled") case .failed : print("Scroll failed") default : print("unknown state") } }