IPhone - "Open In" in the SDK?

The DropBox application allows you to view a document in another application by selecting the Open In option.

We are creating a document management application and should be able to view Word / Excel documents, such as Dropbox, in another application.

Where in the SDK do I look so that I can transfer the document to another application to open in it?

Jan

+7
source share
1 answer

You will need the UIDocumentInteractionController class.

It is available in UIKit, so you do not need a specific infrastructure for this.

You create an instance of this class using the URL of the file you want to transfer to another application that can handle the file type:

 UIDocumentInteractionController * controller; controller = [ UIDocumentInteractionController interactionControllerWithURL: someFileURL ]; 

Then you can submit it:

 [ controller presentOpenInMenuFromRect: someRect inView: someView animated: YES ]; 

Please note that on the iPad you will need to save the controller, otherwise it will be released, which will lead to the crash of the application.

This method returns a BOOL value. NO returned if an application for the file type was found. In this case, you can display a warning.

+12
source

All Articles