Document Preview and Custom Activities

I would like to do two things:

  • Utilize iOS's robust document preview capabilities as demonstrated by classes like QLPreviewController.
  • Be able to provide my own UIActivityViewController when previewing the document. Or somehow have the ability to add/remove activities presented by any default activity sheet.


As far as I can tell, via research and experimentation, is that this just isn't possible. But that seems crazy to me. I'm aware of options like QLPreviewController and UIDocumentInteractionController (which seems to just use QLPreviewController to actually preview the document). Both of these options result in an action bar button that presents a UIActivityViewController which cannot be customized at all. The other options are:

  • WKWebView. But WKWebView is kind of buggy when it comes to rendering these things and doesn't support the full range of documents that QLPreviewController does.
  • PDFView. This seems to work fine for PDFs, but obviously the whole point is to support a wide array of documents.


It seems so odd to me that it's not possible to combine the document preview capabilities inherint in iOS while also being able to customize the presented sharing options. They're not at all related. I'm hoping I've just missed something simple. Any guidance would be appreciated.


PS. I've discovered that subclassing QLPreviewController, pushing it onto a nav controller, and overriding the navigationItem property to supply my own navigation item and action bar button seems to meet these requirements. But, that can't be Apple's intended method by which my goal is achieved. It seems/almost certainly is a hack that I'd like to avoid.