Problem with image zoom!!

Hi all, I'm trying to zoom in on an image that is updated every second. I have tried many ways (scroll view above all) but I like none very much. the most interesting way was to create a PDF with this code:

self.pdfView = PDFView(frame: self.view.bounds)
self.pdfView.displayDirection = .vertical
self.pdfView.displayMode = .singlePage
self.pdfView.backgroundColor = UIColor.white
               
if let pdfPage = PDFPage(image: self.image) {
    let pdfDoc = PDFDocument()
             pdfDoc.insert(pdfPage, at: 0)
                 
            self.pdfView.document = pdfDoc
            self.pdfView.autoScales = true
            self.pdfView.minScaleFactor = self.pdfView.scaleFactorForSizeToFit
             
          }
          self.view.addSubview(self.pdfView)

I really like the zoom this way, but I have no ability to update the PDF image. is this possible? Or do you have other easy ways to zoom?

Thank you.

Problem with image zoom!!
 
 
Q