I'm attempting to implement a feature where a user can select some text in a WebView and, after releasing the mouse button, a small window will pop up to allow the user to perform some operations on the selected text.
However, I'm running into some trouble with determining when the user's selection has been "confirmed", for lack of a better word, by releasing the mouse button. The WebEditingDelegate
informal protocol defines a -webViewDidChangeSelection:
method, but it's called every time the selection changes at all. So, for example, if the user drags across an entire line, -webViewDidChangeSelection:
is called many times – once for each time the selected range changes. Obviously, this wont work, since I'd be popping up my window several times over the course of the drag.
Does anyone know of a way to accomplish what I need?