Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS: Is it possible to customize the "Open in..." menu when previewing a document?

I'm looking to leverage either UIDocumentInteractionController or QLPreviewController to preview both PDFs and images inside my application. I'm wondering if any of the following customizations are possible (I've scoured the documentation without any luck).

  • Remove the "Open in..." menu completely (e.g. the user can preview an image but can't export it to a different application)

  • Have the "Open in..." menu open a file OTHER than the one being previewed (e.g. the preview is of a PDF document but the "Open in..." menu will actually export an ePub file)

UIDocumentInteractionControllerDelegate has a method documentInteractionController:canPerformAction: which seems similar to what I'm looking for, but the documentation indicates that copy: and print: are the only supported selectors.

(Also, less important, but is it possible to modify the UIModalTransitionStyle or UIModalPresentationStyle of either a UIDocumentInteractionController or a QLPreviewController? Since QLPreviewController is a subclass of UIViewController, I figured I'd be able to set the modalTransitionStyle and modalPresentationStyle properties, but this didn't yield the desired results.)

like image 669
Bryan Irace Avatar asked Dec 06 '10 20:12

Bryan Irace


1 Answers

This has been asked a few times before and it doesn't seem like much customization is allowed. However, it does seem possible to add an extra UIBarButtonItem to a UIDocumentInteractionController (second link below). As for custom transitions, if you've tried modalTransitionStyle and modalPresentation style then I'm going to assume you can't. I can't find any information about it, but I could always be wrong.

Can I hide the Action button on the UIDocumentInteractionController view?

Custom "Email" action in UIDocumentInteractionController

UIDocumentInteractionController adding custom actions to menu (eg email, save to photos)

like image 178
Brandon Schlenker Avatar answered Oct 25 '22 19:10

Brandon Schlenker