Swift laggy zooom in/out PDFView in .singlePage mode

36 Views Asked by At

Why is using PDFView in .singlePage mode when I try to zoom in and zoom out is lagging?

I don't have any kinds of strange settings, just create a project from scratch to replicate this.

func displayPDF() {
    pdfView = PDFView(frame: CGRect(x: 0, y: 0, width: view.frame.width, height: view.frame.height))

    if let pdf = Bundle.main.url(forResource: "sample_pdf", withExtension: "pdf", subdirectory: nil, localization: nil)  {

        let doc = PDFDocument(url: pdf)
        pdfView.document = doc
    }
    pdfView.displayMode = .singlePage
    view.addSubview(pdfView)
}

This is an example of what is going on:

https://streamable.com/eyxiw2

0

There are 0 best solutions below