collectionView(_:shouldBeginMultipleSelectionInteractionAt:) triggered by trackpad click

In my collection view I have allowsSelection, allowsSelectionDuringEditing, and allowsMultipleSelectionDuringEditing set to true.

In my delegate's collectionView(_:shouldBeginMultipleSelectionInteractionAt:) I return true unconditionally, getting me the desired behavior of triggering edit mode with a two-finger swipe. So far so good.

The problem is that collectionView(_:shouldBeginMultipleSelectionInteractionAt:) is also called on a single-finger click from a trackpad. Tapping one of my cells is supposed to open a sub-screen, so with this happening there's no way to navigate my screen using a trackpad. This also goes against the documentation, which says this delegate method is supposed to get called because of a two-finger swipe.

Is there a way to keep that call from happing from a trackpad click? Or a way to distinguish whether I'm getting the call because of an actual two finger swipe?

I have tried these workarounds:

  • Install my own pan gesture recognizer to help detect when shouldBeginMultipleSelectionInteractionAt is being called for an actual two finger swipe. But in the delegate callback, I don't see that the gesture recognizer has triggered.
  • In the callback, examine the collection view's list of gesture recognizers and return false if any one-finger gestures have triggered. This did not work very consistently.

I filed a bug report for this as FB16451771, including a sample project.

collectionView(_:shouldBeginMultipleSelectionInteractionAt:) triggered by trackpad click
 
 
Q