UIDocumentPickerViewController & # 8594; "No documents" because iCloud is not available

I use this method to show the UIDocumentPicker:

func showDocumentPicker(){ let docPicker = UIDocumentPickerViewController(documentTypes: ["public.composite-content "], inMode: UIDocumentPickerMode.Import) docPicker.delegate = self docPicker.modalPresentationStyle = UIModalPresentationStyle.FullScreen self.presentViewController(docPicker, animated: true, completion: nil) } 

UIDocumentPicker displays well, but always shows

The document is missing, documents on the iCloud drive are not available because the iCloud Documents and Data option is disabled

enter image description here

But when I check iCloud status, iCloud Drive is on! (My application even appears in the settings there, also included!)

enter image description here

This happens on the Simulator and on the device (via preload distributed by Apple TestFlight)

+6
source share
1 answer

This error may be caused by invalid UTI constants:

Make sure you double check the UTIs that you pass to the documentTypes parameter. In this case, pay attention to the empty space in the line public.composite-content

+9
source

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


All Articles