Search code examples
iosobjective-cxcodemacosmac-catalyst

Mac Catalyst - Adding Click + Drag gesture to UITableView/UIScrollView


I am in the process of enabling Catalyst support for a freelancing project — one of the things that I noticed right away is the differing behaviour of scrolling views on MacOS vs iOS. I expected to be able to click and drag UIScrollViews or UITableViews as I would normally in the iOS Simulator, but I am only able to scroll these views using the mouse's scroll wheel (or two finger gesture on a trackpad).

Is there any way I can mimic the UIPanGestureRecognizer behaviour on iOS for a UIScrollView or UITableView using a Click + Drag gesture on MacOS?

Thank you :)


Solution

  • I noted the same for UICollectionViews. I decided to use scroll buttons and have them set the selection, and offsets. You can do the same with UIGestureRecognizers in each cell and then set the offsets, etc of the parent UITableView or UICollectionView. I've not thought about simple UIScrollViews.