I want to catch an event when the user completes the selection of changes in the UITextView. The method textViewDidChangeSelection:calls several times while the user drags the cursor. I try to use touchesEnded:withEvent:, but it does not call. Try adding a pan gesture, but the pan handler does not call.
textViewDidChangeSelection:
touchesEnded:withEvent:
UITextInputDelegate selectionDidChange(_:)Called when the user has finished changing selections (lifts a finger from selection descriptors). On UITextViewset your class as inputDelegate. This works for read-only text views.
UITextInputDelegate
selectionDidChange(_:)
UITextView
inputDelegate
, . .. selectedRange textViewDidChangeSelection: , selectedRange.length . , -, .
selectedRange
selectedRange.length
I think you will have to subclass UITextViewand implement touchesEnded:withEvent:to find out when the user stops changing choices.