Search code examples
swiftpdfpdfkit

How to display current page using PDFKit on Swift


How to display the current PDF page when reading a PDF file using the PDFKit on swift ? That small box on the top or bottom of the page displaying “ 1 of 20 “ for example.


Solution

  • You can get the current page like this:

    let currentPageIndex = pdfDocument.index(for: pdfView.currentPage!)