Search code examples
iosuidocumentbrowservc

UIDocumentBrowserViewController without iCloud


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?


Solution

  • 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.