1 UISupportsDocumentBrowser(Supports Document Browser)
设置为true 这样就可以在自带应用“文件”中看到自己app对应名称的文件。
同时LSSupportsOpeningDocumentsInPlace参数也会影响打开文件后-(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:获取数据,最好设置为false(NO).
注意:
有时候重启手机并且保存过文件才可以显示出文件夹。
设置为true 后,通过 -(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options{} 打开的文件无法获取对应的内容,通过[NSData dataWithContentsOfURL:url] 获取不到任何值,不知道原因。
删除Supports Document Browser 后, 通过-(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options{}的url可以正确获取文件内容,[NSData dataWithContentsOfURL:url] 有值
2 CFBundleDocumentTypes(Document types)
设置为下面内容,选择文件-分享-就可以找到自己的app选择其打开。
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>ShareImage</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSHandlerRank</key>
<string>Default</string>
<key>LSItemContentTypes</key>
<array>
<string>public.archive</string>
<string>public.data</string>
<string>public.text</string>
<string>public.image</string>
<string>public.source-code</string>
<string>public.audiovisual-content</string>
<string>com.adobe.pdf</string>
<string>com.apple.keynote.key</string>
<string>com.microsoft.word.doc</string>
<string>com.microsoft.excel.xls</string>
<string>com.microsoft.powerpoint.ppt</string>
</array>
</dict>
</array>
3 UIUserInterfaceStyle(Appearance)
设置为 Light,一直是浅色模式,就是禁用暗黑模式(深色模式)