Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 11 Files App: How to include files from app bundle

I watched the keynote this year at WWDC and am excited about all the new feature additions being brought to iOS 11. The high importance Apple has placed on games in the App Store and the biggest upgrades in the history of iPad is very exciting. But what was most thriling to me was that iOS 11 will bring for the first time some sibilance of a file system to iOS. They call it the Files app, naturally. It seems a big step forward in the new user's getting that same windows-like experience from Microsoft products into iOS.

My question though as a developer currently in development of a project that is heavily document oriented, how am I to be forward looking in my design as so to handle this capability? I know now that Apple allows your app to expose the documents directory of your application sandbox to the user via iTunes if you enable this capability in your .plist using the Application supports iTunes file sharing key. Will this work the same way for the Files app? Meaning, will the Files app expose the documents folder of all the apps on your device that have the Application supports iTunes file sharing key set to YES in the app's .plist?

like image 810
Brandon A Avatar asked Jun 06 '17 17:06

Brandon A


People also ask

How do I add files to Files app iPhone?

On an iPhone, you can only drag and drop files inside the Files app itself. On an iPad, you can drag files out of the Files app into other apps, or drag files from other apps into the Files app. On an iPad, you can long-press a file in the Files app and drag it to another app to move the file around.


2 Answers

Just add Supports Document Browser (UISupportsDocumentBrowser) key to Info.plist and set it to YES.

The documents folder will be shown in On My iPhone section if there are files inside.

like image 158
Emma Labbé Avatar answered Sep 21 '22 02:09

Emma Labbé


If your app supports iTunes file sharing, and if the Info.plist key "Supports opening documents in place" (LSSupportsOpeningDocumentsInPlace) is also set to YES, files in your app's Documents directory will be visible in the Files app. That is safe if you have a UIDocument-based app.

like image 36
matt Avatar answered Sep 20 '22 02:09

matt