wwdc2022-10089 issue

Hi,

I'm trying to use PencilKit over PDFKit as described in <https://developer.apple.com/videos/play/wwdc2022/10089/>. The thing is I open my custom UIDocument and initialize all its content to feed PDFView. Everything seems to work, I Input sketches in the canvas, PDFPageOverlayViewProvider's overlayView(for:) generates canvas correctly (it seems) but when editing finishes : willEndDisplayingOverlayView never gets called, and when I save the UIDocument (I use document.close(completionHandler:)) contents(forType:) never sees my custom PDFPages and I get no content for sketches.

Does anyone of you have an idea of the lifecycle we should follow to get the methods called ?

Sincerely yours

I definitely do something wrong or the lifecycle of willEndDisplayingOverlayView has issues. It fills my custom AFPDFPages only when I scroll to another page (I cannot edit single page documents) or when the app goes in background. What is the lifecycle of a PDFPageOverlayViewProvider ?

wwdc2022-10089 issue
 
 
Q