Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable interaction on NSTextAttachment?

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.

like image 356
an0 Avatar asked May 28 '14 14:05

an0


1 Answers

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

like image 88
Cocoanetics Avatar answered Oct 20 '22 01:10

Cocoanetics