更新时间:2021-10-24 00:42:40
对于新的PDFKit,
For new PDFKit,
您需要导入PDFKit
然后创建一个PDFView视图,并提供一个PDFDocument来查看该视图的文档.检查以下代码以供参考.
Then create a view of PDFView and give a PDFDocument to view's document. Check the below code for reference.
let pdfView = PDFView(frame: self.view.bounds)
let url = Bundle.main.url(forResource: "pdfFile", withExtension: "pdf")
pdfView.document = PDFDocument(url: url!)
self.view.addSubview(pdfView)