4

I have had a document browser app up since iOS 11 (using UIKit/UIDocumentBrowserViewController). The app (let's call it "MyApp") used to create a "MyApp" folder in iCloud Drive (and/or on the device, depending on the choice made in Settings), where documents would be saved automatically.

After updating my device to iOS 15 and recompiling, without any changes to the code, the app seems not to recognize its own folder in iCloud Drive anymore. Every time a file is opened/imported from outside the app (Files, Mail, etc.), the app creates a new "MyApp" folder in iCloud Drive and saves the document there. The existing folder is renamed "MyApp 2" (and then "MyApp 3", "MyApp 4" etc. if I try to import another document).

This seems to happen only in iCloud Drive. If I choose in Settings to save documents on my device, all documents are automatically imported into the "My App" folder, as it was the case in iOS 14 and earlier.

I also tried to create a test app from scratch using the Xcode 13 UIKit document-based app template, and the behavior seems to be exactly the same... so it looks like a bug in UIDocumentBrowserViewController was introduced with the iOS update.

Did anyone notice the same? Is there a solution/workaround? Should a bug report be filed?

Thank you for your help.

[EDIT] If anybody is interested, this is the simplest way to reproduce the issue using the Xcode template:

  • Create a new project in Xcode 13.0
  • Choose iOS -> Document App
  • Choose Interface: Storyboard and create the project (for simplicity let’s use “MyApp” as Product Name)
  • Build and install MyApp on a device running iOS 15.0 or 15.0.1 with iCloud Drive enabled
  • Leave the default setting for Document Storage (i.e. iCloud Drive) in Settings -> MyApp
  • Create a text file with any content and save it with extension “exampletext” (i.e. the imported type identifier used by the app template - let’s call the file “test.exampletext”)
  • Send an email to an inbox accessible from the device with test.exampletext as attachment
  • Open Mail on the device, long-press on test.exampletext and share it to MyApp
  • If a folder “MyApp” exists in iCloud Drive, it will be renamed to “MyApp 2”; a new “MyApp” folder will be created and test.exampletext will be saved in the new folder
  • Sharing again test.exampletext from the mail to MyApp will create another “MyApp” folder and rename the previous one; an arbitrary number of “MyApp n” folders can be created in this way, each including one copy of the document
emime
  • 65
  • 7
  • Definitely report this to Apple, please. – matt Oct 04 '21 at 16:36
  • I did, I submitted the above description via the Apple Feedback Assistant yesterday. I hope this can/will be fixed soon... – emime Oct 05 '21 at 07:44
  • Still not fixed in 15.1. Just ridiculous. I reached out to developer support and they said file a feedback. I’m trying with them again. – cvb Oct 19 '21 at 00:05
  • @emime They seemed to acknowledge my feedback today. – cvb Oct 20 '21 at 01:36
  • @cvb Thank you, let's hope for the best. My feedback was submitted on Oct 4, and in the feedback assistant it still says "Open" with "Less than 10" similar reports: I am a bit surprised, are there so few apps using UIDocumentBrowserViewController out there? – emime Oct 21 '21 at 06:17
  • @emime I think thats the case. It’s obvious they created the bug doing something else. It was fine in iOS 14. – cvb Oct 22 '21 at 00:47
  • @emime Apple reached out to me. It's fixed in the 15.2 beta. A good way to get them to fix things seems to be via developer services. I guess for really bad bugs though. – cvb Oct 28 '21 at 12:25

1 Answers1

1

This is fixed in the 15.2 beta.

cvb
  • 1,715
  • 18
  • 22