Getting Caret Bounding Boxes in Editable WebView

For the word processor that I write, I sometimes need to know the coordinates of the carriage (the reason is long and uninteresting for the question itself). I am writing an application. in Objective-C. I don’t want to call JavaScript, and I don’t want to do “tricks” like changing the DOM to get carriage coordinates (one solution would be to insert an empty range at the carriage position and measure its bounding box), I was looking for methods that cannot Get the selected domrange bounding box.

The only thing I found was caretRectAtNode: offset: affinity in WebCoreFrameBridge (and other methods that seem to do what I want). So I see basically two answers to my question

1) There is a magic method in WebView that I do not consider

2) Tell us how to call methods inside WebCoreFrameBridge using Obj-C and reference WebView / Frame / etc.

+3
source share

All Articles