If you tap a UITextView, the selectedRange property is set. I want to intercept that call and possibly change the location. Is there any way to do that?
I tried implementing
-(void) setSelectedRange: (NSRange) theRange
in my subclass. This intercepts it just fine if I am setting the range. But if Apple’s code is doing the setting (as happens with a tap), my subclass setSelectedRange method does not fire.
Thanks
Instances of
UITextViewsend a-textViewDidChangeSelection:notification to their delegate whenever the selection changes, so you could implement that in your controller (don’t forget to make it the text view’s delegate of course), and have the controller manipulate theselectedRangeproperty itself.