I've started using UIDocumentInteractionController for a new app but I'm wondering how to add additional actions to the action menu that you get on the preview screen?
It seems that the menu only lists apps that have registered for a given url type plus I'm seeing PRINT showing up on iOS4.2. I would like to add send by email and save to photos but don't see a way of extending this menu. I can code the actions I want OK, it's just adding them into the menu that seems impossible?
Am I missing something obvious?
To display email and 'save to' options you should use
or
As described in UIDocumentInteractionController.h :
While using
or
email, sms and 'save in photo/video' are not displayed.
If other actions are required that are not recognized, consider using UIActionSheet.
I cannot comment yet so I'm answering instead :-)
You should give QuickLook framework a try. In my case, I searched all over how to customize UIDocumentInteractionController and failed to find anything useful. I achieved what I wanted (in my case, having a preview "view" inside another view) using QuickLook. Here's a sample code, to have a QLPreviewController as a child controller (being able to create the parent controller freely, which will do the trick in your case).
You will also need some delegates: QLPreviewControllerDataSource and QLPreviewControllerDelegate
and also some need to implement:
return NSURL to the resource
return the number of items to preview (in my case, 1)
i could suggest a simple UIActionSheet or better a popover if you are on iPad with inside a table view with apps and you can manually add Print,email and everything else.
You are correct, These are the methods
The supported action selectors for these methods are copy: and print:.