Importing document with UIDocumentPickerViewController warns "fileprovider plugin was invalidated"

1k views Asked by At

Anytime I import a document via UIDocumentPickerViewController, I see a message logged to the console:

TestApp[66587:1550086] plugin com.apple.UIKit.fileprovider.default invalidated

Does this mean theres something wrong with my code? Or is this just an expected warning? Is there anyway to suppress it?


@IBAction func attachFile(sender: UIButton) {
    let documentPicker = UIDocumentPickerViewController(documentTypes: ["public.image"], inMode: .Import)
    documentPicker.delegate = self
    self.presentViewController(documentPicker, animated: true, completion: nil)
}

func documentPicker(controller: UIDocumentPickerViewController, didPickDocumentAtURL url: NSURL) {
}
1

There are 1 answers

0
Monika mitruka On

I am using xcode 8.3.2 and swift 3.0...Here is my code...it is working well..just call openDocumentPicker() i hope it helps you

extension AddCaseStep3ViewController : UIDocumentMenuDelegate,UIDocumentPickerDelegate{
public func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentAt url: URL) {
    let url = url as URL

    //this is the url of your doc you can send enjoy!!
}

@available(iOS 8.0, *)
public func documentMenu(_ documentMenu:     UIDocumentMenuViewController, didPickDocumentPicker documentPicker: UIDocumentPickerViewController) {

    documentPicker.delegate = self
    present(documentPicker, animated: true, completion: nil)

}

func documentPickerWasCancelled(_ controller: UIDocumentPickerViewController) {
    //dismiss(animated: true, completion: nil)
}

func openDocumentPicker(){
    //
    let documentPicker = UIDocumentPickerViewController(documentTypes: ["public.content","public.data","kUTTypePDF"], in: .import)
    documentPicker.delegate = self
    documentPicker.modalPresentationStyle = .formSheet
    self.present(documentPicker, animated: true, completion: nil)
}}