Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Quick Look for iOSBy Robert Brown@robby_brown
What is Quick Look?Previews all common filesIncludes AirPrintAvailable since iOS 4.0
QLPreviewItemProtocol for previewing files(Required) -(NSURL)previewItemURL  Must be a file URL (i.e. file://somefile.txt)  Us...
QLPreviewControllerSubclass of UIViewControllerCan be pushed into view or presented modallyMust have a data sourceMay have...
QLPreviewControlleriWork Documents     Text files (with supported                    UTI)Microsoft OfficeDocuments (1997+)  ...
QLPreviewControllerDataSource Similar to UITableViewDataSource Tells how many QLPreviewItems it provides Returns a QLPrevi...
QLPreviewControllerDelegate Provides call backs for when the view will dismiss and did dismiss Provides a couple animation...
UIDocumentInteractionController Manages user interactions with files on the local system More control than QLPreviewControl...
Inter-app File Sharing Files aren’t “shared,” they are copied into the app’s sandbox (~Documents/Inbox) An app’s Info.plis...
Inter-app File Sharing CFBundleDocumentTypes sub keys:  CFBundleTypeName: Name of the type  CFBundleTypeIconFiles: array o...
Inter-app File Sharing LSHandlerRank (in order of precedence):   Owner: Creator of these files   Alternate: Secondary viewe...
Inter-app File Sharing Developer tip: Use mdls command on a file to see its UTI tree
Questions?
Demo
Want to learn more?robsprogramknowledge.blogspot.comDocument Interaction Programming Topics for iOSWWDC 2010 Session 106
Upcoming SlideShare
Loading in …5
×

Quick Look for iOS

4,357 views

Published on

Ever wanted to preview files like Apple's Mail app does? Quick Look is an Apple framework that lets you do just that.

Published in: Technology
  • Sex in your area is here: ♥♥♥ http://bit.ly/2F90ZZC ♥♥♥
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Dating for everyone is here: ❶❶❶ http://bit.ly/2F90ZZC ❶❶❶
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

Quick Look for iOS

  1. 1. Quick Look for iOSBy Robert Brown@robby_brown
  2. 2. What is Quick Look?Previews all common filesIncludes AirPrintAvailable since iOS 4.0
  3. 3. QLPreviewItemProtocol for previewing files(Required) -(NSURL)previewItemURL Must be a file URL (i.e. file://somefile.txt) Use [NSURL fileURLWithPath:somePath](Optional) -(NSString)previewItemTitleNSURL conforms to QLPreviewItem
  4. 4. QLPreviewControllerSubclass of UIViewControllerCan be pushed into view or presented modallyMust have a data sourceMay have a delegate
  5. 5. QLPreviewControlleriWork Documents Text files (with supported UTI)Microsoft OfficeDocuments (1997+) CSVRTF HTMLPDFImages
  6. 6. QLPreviewControllerDataSource Similar to UITableViewDataSource Tells how many QLPreviewItems it provides Returns a QLPreviewItem when asked
  7. 7. QLPreviewControllerDelegate Provides call backs for when the view will dismiss and did dismiss Provides a couple animation call backs One call back asking permission to open URLs
  8. 8. UIDocumentInteractionController Manages user interactions with files on the local system More control than QLPreviewController Only previews one file Provides easy access to a file’s icons Provides access to annotation property for passing custom data with a file
  9. 9. Inter-app File Sharing Files aren’t “shared,” they are copied into the app’s sandbox (~Documents/Inbox) An app’s Info.plist specifies which files are accepted with the CFBundleDocumentTypes key CFBundleDocumentTypes is an array of dictionaries
  10. 10. Inter-app File Sharing CFBundleDocumentTypes sub keys: CFBundleTypeName: Name of the type CFBundleTypeIconFiles: array of icons (smallest to largest) LSItemContentTypes: array of UTIs LSHandlerRank: Owner, Alternate, None, Default
  11. 11. Inter-app File Sharing LSHandlerRank (in order of precedence): Owner: Creator of these files Alternate: Secondary viewer None: Files can only be loaded through iTunes Default: Accepts files
  12. 12. Inter-app File Sharing Developer tip: Use mdls command on a file to see its UTI tree
  13. 13. Questions?
  14. 14. Demo
  15. 15. Want to learn more?robsprogramknowledge.blogspot.comDocument Interaction Programming Topics for iOSWWDC 2010 Session 106

×