问题
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:
orpresentOptionsMenuFromBarButtonItem:animated:
method. - To prompt the user only to open the file in another app, call the
presentOpenInMenuFromRect:inView:animated
: orpresentOpenInMenuFromBarButtonItem: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