How to disable interaction with NSTextAttachment?

In a UITextView with editable = YES and selectable = NO, I want to disable interaction with NSTextAttachments. To be more specific, I do not want long clicks on NSTextAttachments to display attachment images. I want these long click gestures to be passed to UITextView as regular text selection gestures.

What I tried: textView:shouldInteractWithTextAttachment:inRange: may interfere with the action screen, but cannot prevent the image from being temporarily highlighted by the attachment, nor can it cause these long clicks to process text selection gestures.

+6
source share
1 answer

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

0
source

Source: https://habr.com/ru/post/969978/


All Articles