When you double tap on a UITextView, it will by default select the closest word which generally works fine. The problem is that if my textview contains something such as:
SELECT * FROM my_table
and you double tap on the table
part of my_table
, only table
will be selected, however I want to select the entire my_table
string.
I can fix this myself by adding a UITapGestureRecognizer
and handling double taps, detecting ranges myself and selecting the range myself, however I was wondering if there was anything I could override on UITextView to handle this case (for example macOS has a doubleClickAtIndex method which can be overridden to handle this exact case.