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

这一生的挚爱 提交于 2019-12-23 09:17:26

问题


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?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/44395988/ios-11-files-app-how-to-include-files-from-app-bundle

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!