Is there a way to either ignore when a widget is tapped while still capturing the .PDFViewAnnotationHit
notification, or deselecting the textbox widget programmatically?
I did not find a way to programatically end editing a text annotation.
However, I found a workaround solution that worked in my case. Instead of using a textbox annotation, I used just a label annotation. When the label annotation was hit, I hide it and I placed a textView
over the PDFView with the same bounds, and font as the pdf annotation label. Now, with the textview added programatically to the view you have full control. When done editing, the text annotation label was updated and the textView was removed.
I found this workaround rather similar to the internal implementation of the textbox widget annotation. The final implementation also supported the text annotation to be resized by width, or repositioned in the page by dragging, or updated it's font size and color.