简体   繁体   English

Swift:如何将其他文件导入到您的应用

[英]Swift: How to import other files to your app

I am developing a file manager app , and I need to users able to import other files to my application, I searched many question but did not success ! 我正在开发一个文件管理器应用程序,我需要用户能够将其他文件导入到我的应用程序中,我搜索了很多问题,但未成功!

First I register file types using : Registering the File Types Your App Supports , 首先,我使用以下方法注册文件类型: 注册您的应用支持的文件类型

在此处输入图片说明

But when I tap share icon on safari or photos there my app won't show in list of apps. 但是,当我点击野生动物园或照片上的共享图标时,我的应用程序将不会显示在应用程序列表中。 And then what is the next step to import files and store it to Document Directory of my app? 然后,导入文件并将其存储到我的应用程序的Document Directory的下一步是什么?

In iOS other apps will not just automatically communicate with your app. 在iOS中,其他应用不仅会自动与您的应用通信。 You have to create an extension that lets the other apps like Safari or Photos know that your app can talk to them. 您必须创建一个扩展程序,使其他应用程序(例如Safari或“照片”)知道您的应用程序可以与它们对话。 A basic description for this can be found in the App Extension Programming Guide . 可以在《 应用程序扩展编程指南》中找到对此的基本描述。

There they also point you towards sources on how to work with the iOS file system. 他们还在那里为您提供有关如何使用iOS文件系统的信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何访问云端硬盘以在swift中将文件导入我的应用程序? - How to access Cloud drives to import files to my app in swift? 如何为您的 Swift 框架私下导入第 3 方框架 - How to import 3rd party framework privately for your Swift framework swift如何知道要导入哪些文件? - How does swift know which files to import? 如何使用共享容器/应用程序组从Swift中的其他目标访问文件 - How To Use Shared Container/App Groups To Access Files From Other Targets in Swift 如何使用Google回调URL方案快速返回到您的应用程序? - How to return to your app using google callback url scheme in swift? 如何在已添加到应用程序工作区的应用程序中导入 Swift Package - How to import Swift Package in App already added to Workspace of App 如何在Swift 4的Cocoa Touch Framework中手动导入XMPPFramewrok文件? - How to import XMPPFramewrok files manually in Cocoa Touch Framework in Swift 4? 无法在Swift应用中导入Firebase - Cannot import Firebase in Swift app 如何在 Swift 中的其他文件和/或函数中调用 TableView 标题部分中的按钮? - How to call button in TableView header section in other files and/or functions in Swift? 为您的应用创建链接,以供其他应用启动 - Creating a link for your app to be launched by other apps
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM