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
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
Uidocumentinteractioncontroller Does Not Open Other App in iOS 11
Indexpathforrowatpoint Returns Nil Only for First Cell in a UItableview
Customize Google Maps Blue Dot for Current Location
How to Present Uiview (Xib) as Alert View in Swift
iOS 8 Uitableview First Row Has Wrong Height
How to Set The Date and Time Programmatically in iOS
How to Rotate a UIview Without The Black Bars
How to Get the Index in Results of a Certain Realm Object
How to Convert Cgpoint in Nsvalue in Swift
No Such Module 'Fbsdkcorekit' Xcode 7.4
How to Change Brightness, Contrast and Saturation Using Cicolorcontrols via Uislider with Swift
Apple Doesn't Recognize Imgur's Https
Value of Type 'string' Has No Member 'stringbytrimmingcharactersinset'