Importing a document with UIDocumentPickerViewController warns that "the plugin file was invalid"

At any time, when I import a document through the UIDocumentPickerViewController , I see a message registered on the console:

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

Does this mean that something is wrong with my code? Or is this just an expected warning? Is there any way 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) { } 
+6
source share
1 answer

I am using xcode 8.3.2 and swift 3.0 ... Here is my code ... it works well ... just call openDocumentPicker (), hope this 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) }} 
0
source

Source: https://habr.com/ru/post/989101/


All Articles