How to send files to another app on ios

半世苍凉 提交于 2019-12-10 10:13:39

问题


Dropbox application permit to send files to other applications like teamviewer or iBook. How do they do that?

I thought the only way to send data to another application was the url scheme.


回答1:


I think Dropbox using Document Interaction API to provide this functionality.

Quotes from docs:

You can use a document interaction controller to display a file preview or to prompt the user to choose an action for a file.

  • To modally display a file preview, call the presentPreviewAnimated: method.
  • To prompt the user with a set of options, including an option to open the file in another app, call the presentOptionsMenuFromRect:inView:animated: or presentOptionsMenuFromBarButtonItem:animated: method.
  • To prompt the user only to open the file in another app, call the presentOpenInMenuFromRect:inView:animated: or presentOpenInMenuFromBarButtonItem:animated: method.



回答2:


UIDocumentInteractionController gives the user the option to open a file using other applications.



来源:https://stackoverflow.com/questions/8876648/how-to-send-files-to-another-app-on-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!