3

Apple says that in order to display your app's documents in the Files app, your Info.plist must turn on "Supports document browser" on the one hand, or "Application supports iTunes file sharing" and "Supports opening documents in place", on the other.

But in a moment of idle curiosity, I tried turning on all three of them, and it worked. My test app is document browser-based, but it can keep (and browse) documents in its Documents folder as well as in iCloud. And even if the user turns off iCloud Drive, my app keeps working, in that sense.

My question (rather vague) is: is that legal? Apple makes these two approaches seem mutually exclusive, but are they in fact compatible? Has anyone written a serious app that has all three of those options turned on in the Info.plist, so as to browse the app's own local documents from within the app's own file browser?

matt
  • 515,959
  • 87
  • 875
  • 1,141

1 Answers1

3

Yes, this is non-exclusive. You should probably file a bug to make the documentation clearer.

The idea is that you need to store only user-visible content in the Documents directory (some apps keep program data that are not user-created files in there). If you support the document browser, then obviously you are not mis-using this directory. Same if you support iTunes file sharing.

As far as apps on the store go, check out iWork. They use the document browser and support iTunes file sharing.

Thomas Deniau
  • 2,488
  • 1
  • 15
  • 15
  • Thanks, Thomas! The point is an important one, because if your app is UIDocumentBrowserViewController-based and that's all — that is, if it _doesn't_ also support file sharing from the Documents directory — then if the user has iCloud Drive turned off, your app is bricked. That's an unpleasant experience and is likely to keep developers from adopting UIDocumentBrowserViewController; when I discovered it, I thought this meant UIDBVC was a useless toy. Perhaps the template should be revised so that file sharing / open in place are also supported by default... – matt Nov 27 '17 at 19:15
  • Did you file a bug about it? Thanks! – Thomas Deniau Nov 27 '17 at 19:23
  • The option to file a bug against the documentation is gone, I'm afraid... It used to be there was a button right there on every doc page. But now there isn't, and documentation is not listed among the things you can file bugs on in the bug reporter. – matt Nov 27 '17 at 20:43