2

I've been using UILongPressGesture with UITableView for over a year, but I found that this doesn't work in iOS13.

In iOS13, Apple added this gesture to UIScrollView and I'm not sure it is safe to replace it to my own.

<UIScrollViewKnobLongPressGestureRecognizer: 0x7f938c051c00; state = Possible; target= <(action=_handleKnobLongPressGesture:, target= 0x7f938991b000>)>>

Anyone knows about this issue? or knows what _handleKnobLongPressGesture action for?

Ryan
  • 4,799
  • 1
  • 29
  • 56

2 Answers2

4

You didn't show your code or explain what your long press gesture recognizer is for, but your code was probably always wrong. In iOS 13, there are at least two long press gesture recognizers ahead of you:

  • Long press to summon a UIMenu

  • Long press to begin a drag (drag and drop)

It seems improbably that you could add a long press gesture recognizer and manage to negotiate the demands of the runtime's own expectations about what a long press should mean. You're probably better off modifying your gesture to eliminate all possibility of conflict.

matt
  • 515,959
  • 87
  • 875
  • 1,141
  • Thanks. I didn't know I can add 2 type of gestures in a view. Because I constantly add/remove the gesture, I didn't add the gesture in case there is already a longPressGestureRecognizer. It works when I just added. – Ryan Sep 18 '19 at 16:38
3

Not sure what that gesture recognizer is for, it could possibly be related to the new gesture for dragging the scroll indicator but that's just a guess.

One thing you could try to get your working is to set yourself as the delete of your gesture then implement the following delegate method to always return true.

gestureRecognizer(_:shouldRecognizeSimultaneouslyWith:)
Craig Siemens
  • 12,942
  • 1
  • 34
  • 51