0

I would like to access the textView inside the PDFAnnotation of type .widget, widget subtype .text. The reason I want to do this is to select the text inside it or make it first responder so the keyboard is shown after the annotation is added on the PDFPage. The same behaviour is used when an iOS user tries to edit a text annotation added to a screenshot (or PDF document). Is there any way to do that?

crcalin
  • 979
  • 6
  • 13

1 Answers1

0

I found a way to do this for currently-active text fields, described in Configuring keyboard settings within PDFView form fields. In short, parse the PDFView looking for the UITextView used for text entry. Unfortunately when the user exits the PDF text field that UITextView is killed.

So if you only need access during text field editing, you can use the same hack to access the UITextView, then grab its .text property. If you need to access all text fields on the page, however, this won't help.

Mitch Cohen
  • 1,551
  • 3
  • 15
  • 29