This is a supplemental question to a previous answer of mine to the question Detecting taps on attributed text in a UITextView in iOS.
I retested the following code with
In your UITextView's controller,you can implement UITextViewDelegate
, Then override method
-(BOOL)textViewShouldBeginEditing:(UITextView *)textView{
}
Inside this method you can access the textView's selectedRange,which should also be the "tap range" of your attributed text. Then return true / false depending on your needs.