UIDocumentInteractionController不適用於具有多個頁面的大型PDF文件。Swift:UIDocumentInteractionController不工作?
在我的代碼這裏,
var docController:UIDocumentInteractionController!
...
DispatchQueue.main.async (execute: { [weak self] in
self?.docController = UIDocumentInteractionController(url: pdfFileURL!)
self?.docController.delegate = self
self?.docController.name = pdfFileURL?.lastPathComponent
self?.docController.presentPreview(animated: true)
})
和委託方法,
func documentInteractionControllerViewControllerForPreview(_ controller: UIDocumentInteractionController) -> UIViewController {
return self
}
這是在操作檯的警告,
2017-05-26 12:46:51.178894 MyApp [3350:1136818] [default] View service did terminate with error: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "(null)" UserInfo={Message=Service Connection Interrupted} #Remote
下面連接的是空白圖像,
請幫我謝謝。
任何運氣?我在一艘類似的船上。我有一切設置正確,但是當我調用presentPreview(animated:)時,它每次都返回false。它也沒有調用我的委託方法'documentInteractionControllerViewControllerForPreview' – atreat