I know this question is out of date, but to keep it relevant for future search engines, I thought I would add another solution that worked for me from iOS 7 to 10. It basically combines the solutions discussed here and here , but modifies them, to get a UITextView for recognizing a user double click.
He does this by subclassing the UITextView and overriding the addGestureRecognizer: method to embed our custom callback in double-touch gestures and set up a single-touch gesture to respect the new double-tap.
I do this in addGestureRecognizer: because the UITextView constantly deletes and adds gestures depending on its current state, and therefore you constantly have to copy reset.
This code should be enough for someone to start:
@interface MyCustomTextView () @property (weak, nonatomic) UITapGestureRecognizer *singleTap; @property (weak, nonatomic) UITapGestureRecognizer *doubleTap; @end @implementation MyCustomTextView - (void)_handleTwoTaps:(UITapGestureRecognizer *)tgr {
source share