I found a PDFView and PDFThumbnailView in Object Library like this pic:
But my question is how to use it ??? I can't drag it in xib , and no idea to create a PDFView by code .
Any answer or tutorial will be help.
I found a PDFView and PDFThumbnailView in Object Library like this pic:
But my question is how to use it ??? I can't drag it in xib , and no idea to create a PDFView by code .
Any answer or tutorial will be help.
Both PDFView
and PDFThumbnailView
are now available on iOS, as of iOS 11. Code like this should get you going:
let pdfView = PDFView()
pdfView.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(pdfView)
pdfView.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true
pdfView.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true
pdfView.topAnchor.constraint(equalTo: view.topAnchor).isActive = true
pdfView.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true
if let document = PDFDocument(url: pathToYourPDFDocument) {
pdfView.document = document
}