We built our iPad app for MacOS using Catalyst and I cannot figure out how to get two-finger trackpad scrolling gestures to work in a custom UIView. The standard UIKit components (e.g., UITableView) scroll with the standard two-finger trackpad scrolling gestures. But how do you handle them in a custom UIView?
The custom UIViewViewController adds a typical UIPanGestureRecognizer which invokes the gesture handler method when the trackpad is pressed and I move my finger. But it doesn't invoke the handler with just two fingers brushing the trackpad.
You can do this now in iOS 13.4 using this code:
panGesture.allowedScrollTypesMask = UIScrollTypeMask.continuous
https://developer.apple.com/documentation/uikit/uipangesturerecognizer/3538978-allowedscrolltypesmask
Confirmed by Apple DTS that this is not currently possible.
We have reviewed your request and have concluded that there is no supported way to achieve the desired functionality given the currently shipping system configurations.
(Feb 2020)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With