【发布时间】:2020-11-14 14:20:21
【问题描述】:
@IBAction func save(_ sender: Any) {
let path = Bundle.main.url (forResource: "SB", withExtension: "pdf")
pdfView.document?.write(to: path!)
guard let url = Bundle.main.url(forResource: "SB", withExtension: "pdf") else {
print("File loading error!")
return
}
let DOCcontroller = UIDocumentInteractionController(url: url)
DOCcontroller.delegate = self
DOCcontroller.presentPreview(animated: true)
}
func documentInteractionControllerViewControllerForPreview(_ DOCcontroller: UIDocumentInteractionController) -> UIViewController {
return self
}
}
所以我的问题是这适用于 XCodes 模拟,但不适用于真实设备。我在编码方面没有太多经验,这是我的第一个应用程序。
感谢您的帮助:D
【问题讨论】:
标签: ios swift pdf annotations pdfkit