Monday, July 4, 2022
HomeiOS Developmentios - Swift PDFKit the right way to scroll to particular level...

ios – Swift PDFKit the right way to scroll to particular level programmatically


I’ve vertical scrolling pdfView:

var pdfView = PDFView()

        pdfView.displayDirection = .vertical
        pdfView.usePageViewController(false)
        pdfView.pageBreakMargins = UIEdgeInsets(high: 0, left: 0, backside: 0, proper: 0)
        pdfView.autoScales = true
        
        pdfView.backgroundColor = .black

I can scroll and zoom pdf file.

However how can I scroll pdfView programmatically?

pdfView.go(to: someCGRect, on: somePage)

I already know go(to:, on:), but it surely simply jumps to that time and web page with out scrolling.

go(to: PDFPage) Scrolls, however simply specified web page.

reference: https://developer.apple.com/documentation/pdfkit/pdfview/navigation

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments