【问题标题】:How to Save video file to iOS Files App using UIDocumentInteractionController如何使用 UIDocumentInteractionController 将视频文件保存到 iOS 文件应用程序
【发布时间】:2020-08-16 23:31:59
【问题描述】:

我想将一个或多个 mov/mp4 文件写入 iOS 文件应用程序,但找不到如何使用 UIDocumentInteractionController 执行此操作。使用 UIDocumentInteractionController 在 iOS 文件应用程序中寻找示例代码以将文件复制到我的应用程序的子文件夹。查看示例屏幕截图以了解我想要什么。

【问题讨论】:

    标签: ios uikit avfoundation uidocumentinteractioncontroller uidocumentbrowserviewcontroller


    【解决方案1】:

    如果您要远程存储文件,您首先需要为您的应用创建文件提供程序扩展。

    如果它们仅本地存储在设备上,您可以通过(在 Info.plist 中)设置UISupportsDocumentBrowser 键或设置麻烦UIFileSharingEnabled 和@987654324 来实现此目的@键。

    正如documentation 中所述:

    这些键使其他应用能够在适当的位置打开和编辑您的 Documents 目录的内容。您的文件也会同时出现在“文件”应用程序和文档浏览器中。有关详细信息,请参阅 UIDocumentBrowserViewController 类。

    【讨论】:

    • 感谢您的回答。我还需要为我的应用创建一个文件夹。有没有办法创建文件夹?
    猜你喜欢
    • 1970-01-01
    • 2021-09-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-28
    • 1970-01-01
    • 1970-01-01
    • 2018-05-30
    相关资源
    最近更新 更多