The DropBox app lets you view a document in another app by selecting the Open In option.
We are building a document management app and need to be able to view the Word/Excel docs like Dropbox does, in another app.
Where in the SDK do I look so that I can pass a document to another app to open in that one?
Ian
You’ll need to use the
UIDocumentInteractionControllerclass.It’s available in UIKit, so you don’t need a particular framework for this.
You instantiate this class, using an URL to the file you want to pass to another application, which is able to handle the file type:
Then, you can present it:
Note that, on iPad, you’ll need to retain the controller, otherwise it will be deallocated, making your application crash.
This method returns a
BOOLvalue.NOis returned if no application for the file typewas found. In such a case, you may display an alert.