Hi, in my case the overlayView(For:) method is called when I create and display my editing view controller. The issue I have is the willEndDisplayingOverlayView never gets called and when the contents(forType:) is running on the UIDocument I'm saving, it never gets th custom PDFPages drawing content, so I get no data. (althrought the PDFDocumentDelegate is set).
Sorry, I'm 5 months late, but : Did you manage to do something ?
Post
Replies
Boosts
Views
Activity
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 ?
Hi ! I just figured out that setting the PDFDocument to nil in the editing PDFView Briggs the PDFPageOverlayViewProvider willEndDisplayingOverlayView(for:) delegate ! Then all custom pages get their edited content and my custom UIDocument's contents(forType:) can now grab my custom PDFPage content to burn into the .pdf file !
I made a short example here https://github.com/GuillaumeRossit/MyPencilKitOverPDFApp
Hi ! I have q quick example here : https://github.com/GuillaumeRossit/MyPencilKitOverPDFApp It does not work in the correct document folder so save can't be done correctly, but if you transpose it to your own app, it should work.