[英]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.