PDFKit - disable editing annotations (text, chbox, radio)

Hi,


In all Apple documentation I can't find how to disable editing a pdf annotation.

I have a pdf document with annotations (acrofield) as textbox, checkbox and radio button.

I want to disable editing all of this annotations when, for example I press a button.

I dont know how do this. There is no information in the documentation.


Edit:

Set annotation property to isReadOnly = true doesnt work

Replies

I also have this question, any ideas?


Text fields do get set to read-only by removing the annotation, changing it, adding it back and then writing the file to the file system again. But checkboxes and radiobuttons are not read-only

I am also interested in an answer to this question. Did you find a solution?
Code Block swift
        pdfView?.document?.page(at: 0)?.annotations.forEach {
          $0.isReadOnly = true
        }