My App Is Getting Crashed on UIdocumentpickerviewcontroller

My app is getting crashed on UIDocumentPickerViewController

See Prerequisite section on Apple Documentation:

Before your app can use the document picker, you must turn on the
iCloud Documents capabilities in Xcode

Sample Image

Let me know if this solve your problem!

UIDocumentPickerViewController crashes due to missing iCloud entitlement

Happening to my app as well -- I just want to use the File Provider features, and don't support iCloud Drive specifically.

I can't shed any light on why it seems to lose touch with iCloud, but this is not a "crash" -- [[UIDocumentPickerViewController alloc] init___] is throwing an exception, which you can catch with a try/catch block. That is, I suspect your app is crashing with "uncaught exception" -- if you catch it, you can just give an error message.

iOS Document Picker crashes when picking a PDF on a real device

The issue there is that you are using the wrong mode when defining the type of file transfer operation used by the document picker. .open is used to open an external file located outside your app’s sandbox. What you need is to use .import it will create a temporary file that will allow you to load its contents or move/copy the file to a permanent location. If it doesn't solve you issue check this post on how to implement your DocumentPickerViewController coordinator

let controller = UIDocumentPickerViewController(documentTypes: [String(kUTTypePDF)], in: .import)


Related Topics



Leave a reply



Submit