首页 > 移动平台 > 详细

ios11文件夹

时间:2017-09-28 12:14:50      阅读:426      评论:0      收藏:0      [点我收藏+]

File Manager

UIDocumentBrowserViewController

多了一个文件管理的 VC,默认里面会显示当前 app 权限以内的文件,包括本地的和存在 iCloud 的.

如果三方 app 在 info.plist 中声明了 UISupportsDocumentBrowser 或者 UIFileSharingEnabled 和 LSSupportsOpeningDocumentsInPlace 的话,可以获得第三方 app 的文件。

构造方法如下该构造还提供了文件筛选的能力:

 UIDocumentBrowserViewController* view = [[UIDocumentBrowserViewController alloc] initForOpeningFilesWithContentTypes:@[@".txt",@".pages",@".pdf"]];

在使用该 VC 时务必把文件管理里的 VC 作为应用的 根 VC,不要把它放在 navigation,tab 或者 split 视图中,也不要通过模态的样式展现出来。

有上述需求的话用 UIDocumentPickerViewController 来替代

由于文件可能被任何 app 中的 UIDocumentBrowserViewController 修改,所以对文件的操作尽量通过 UIDocument 子类 或者 NSFilePresenter 和 NSFileCoordinator 对象来操作。

技术分享

 

ios11文件夹

原文:http://www.cnblogs.com/supersr/p/7605899.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!