10

In a UITextView with editable = YES and selectable = NO, I want to disable interaction on NSTextAttachments. To be more specific, I don't want long presses on NSTextAttachments to highlight the attachment images. I want these long press gestures to be passed to UITextView as normal text selection gestures.

What I have tried: textView:shouldInteractWithTextAttachment:inRange: can prevent the action sheet but can not prevent the temporary highlight of the attachment image nor can it make these long presses be handled as text selection gestures.

an0
  • 16,371
  • 11
  • 78
  • 132

1 Answers1

2

UITextView has several installed gesture recognisers. There is one that is a subclass of UITapGestureRecognizer which you can disable.

Cocoanetics
  • 7,971
  • 2
  • 24
  • 53