UIDocumentPickerViewController error after closing

1.6k Views Asked by At

I am using a DocumentPickerViewController to import a document in my app. The picker does it's work, there are no bugs and no crashes but every time after a document is picked or the view controller is canceled I get a log with the following error:

[DocumentManager] The view service did terminate with error: 
Error Domain=_UIViewServiceErrorDomain Code=1 "(null)" 
UserInfo={Terminated=disconnect method}

This is the function where the picker VC will be presented:

@IBAction func presentDocumentPicker(_ sender: Any) {
        let documentPicker = UIDocumentPickerViewController(documentTypes: ["com.adobe.pdf"], in: .import)
        documentPicker.delegate = self
        present(documentPicker, animated: false, completion: nil)
    }

This is the delegate extension:

extension ViewController: UIDocumentPickerDelegate {
    public func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentAt url: URL) {
        print(url)
    }
    public func documentPickerWasCancelled(_ controller: UIDocumentPickerViewController) {
        print("Canceled")
    }
}

I also tried using the UIDocumentBrowserViewController but I get the same log. Another thing I tried is enabling the iCloud entitlements but there is no change. With a nav controller and just pushing the DocumentPicker renders the same result. Every test I did was built on both a real device and a simulator.

Is there anything I'm doing wrong? Is there anyway I can get rid of that log showing up?

0

There are 0 best solutions below