iOS-PDF-Reader
iOS-PDF-Reader copied to clipboard
I tried to pass the startPageIndex as 10 but the pdf is not loaded as page 11
I tried to pass the startPageIndex as 10 but the pdf is not loaded as page 11
private func showDocument(_ document: PDFDocument) {
let image = UIImage(named: "")
let controller = PDFViewController.createNew(with: document, title: document.fileName, actionButtonImage: image, actionStyle: .activitySheet, startPageIndex: 10)
navigationController?.pushViewController(controller, animated: true)
}
Could you please advise?
u should move the code " currentPageIndex = updatedPageIndex thumbnailCollectionController?.currentPageIndex = currentPageIndex" on the func scrollViewDidScroll to the other place, like this: public func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) { currentPageIndex = indexPath.row self.title = String(format: "%d/%d",currentPageIndex,self.document.pageCount) thumbnailCollectionController?.currentPageIndex = currentPageIndex }