UIDocumentInteractionController vs QLPreviewController on iOS
Asked Answered
C

1

11

Can anyone who has used both comment on "What's the difference, and when should you use one over the other?" I have spent the last couple days adapting code from the DocInteraction sample to my own app, and the more familiar I become with these two kits, the less difference I see between them:

  • They both display docs
  • They both only present full screen
  • They both have "open in" and "print"
  • They both can zoom from a small rect on screen

I just don't see any difference when switching between them except the color of the toolbar.

Of course I'm missing something (or wrong about those other points). Any thoughts?

Cyaneous answered 1/11, 2011 at 15:51 Comment(0)
G
5

UIDocumentInteractionController uses QLPreviewController to display. It allows for additional hooks for delegate methods.

Growing answered 1/11, 2011 at 18:54 Comment(2)
I'd add, although DIC gives more control over how the controller itself presents the docs, going direct with QL give you more control over how the view is added to the hierarchy, in my estimation. I went with the latter though I still keep a "zombie" former around to query it for icons, etc.Cyaneous
Hmmm. I was thinking it was the other way around, because when I use QLPreviewController and it crashes when tapping the share button, it breaks with [UIDocumentInteractionController setURL:], /SourceCache/UIKit/UIKit-2380.17/UIDocumentInteractionController.m:960Preterite

© 2022 - 2024 — McMap. All rights reserved.