PDFKit PencilKit annotations sample code

Hello,

I was wondering if the sample code shown in Session 10089 of WWDC22 could be made available? To be more specific, I am interested in overlaying a PencilKit PKCanvasView over a PDFKit PDFView. I can't seem to get the PKCanvasView to recognize touch events. This isn't really covered in the session, and I can't get it to work.

I managed to overlay PKCanvasViews by copying the code from the session, but I can't draw anything because the touch events are interpreted by the PDFView as scroll gestures. Any help would be appreciated :)

Thank you!

I have similar problem. did you solve this problem?

Were you able to get the sample code shown in the video? - same issue here.

To recognize touch events in PKCanvasView you should give false to usePageViewController method in pdfview and pass the document eg: PDFView.documet = document after confirming the pageoverlayview delegate to self and Its working for me

You need to also set isInMarkupMode on the PDFView instance to true, so it changes how hit testing works.

PDFKit PencilKit annotations sample code
 
 
Q