SlideShare a Scribd company logo
Quick Look for iOS
By Robert Brown
@robby_brown
What is Quick Look?


Previews all common files
Includes AirPrint
Available since iOS 4.0
QLPreviewItem
Protocol for previewing files
(Required) -(NSURL)previewItemURL
  Must be a file URL (i.e. file://somefile.txt)
  Use [NSURL fileURLWithPath:somePath]
(Optional) -(NSString)previewItemTitle
NSURL conforms to QLPreviewItem
QLPreviewController

Subclass of UIViewController
Can be pushed into view or presented modally
Must have a data source
May have a delegate
QLPreviewController
iWork Documents     Text files (with supported
                    UTI)
Microsoft Office
Documents (1997+)   CSV
RTF                 HTML


PDF
Images
QLPreviewControllerDataSource



 Similar to UITableViewDataSource
 Tells how many QLPreviewItems it provides
 Returns a QLPreviewItem when asked
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
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
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
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
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
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.com
Document Interaction Programming Topics for iOS
WWDC 2010 Session 106

More Related Content

Similar to Quick Look for iOS

WPF Concepts
WPF ConceptsWPF Concepts
WPF Concepts
Doncho Minkov
 
Enterprise Library 2.0 Core Architecture
Enterprise Library 2.0 Core ArchitectureEnterprise Library 2.0 Core Architecture
Enterprise Library 2.0 Core Architecture
mcgurk
 
Developing on Windows 8
Developing on Windows 8Developing on Windows 8
Developing on Windows 8
Einar Ingebrigtsen
 
Beyond Comments: How to Build an Awesome API Doc and Be a Better Person
Beyond Comments: How to Build an Awesome API Doc and Be a Better PersonBeyond Comments: How to Build an Awesome API Doc and Be a Better Person
Beyond Comments: How to Build an Awesome API Doc and Be a Better Person
Alek Davis
 
Feed the Masses
Feed the MassesFeed the Masses
Feed the Masses
pbugni
 
IntelliJ IDEA Architecture and Performance
IntelliJ IDEA Architecture and PerformanceIntelliJ IDEA Architecture and Performance
IntelliJ IDEA Architecture and Performance
intelliyole
 
iOS Course day 2
iOS Course day 2iOS Course day 2
iOS Course day 2
Rich Allen
 
Overview of WPF in light of Ribbon UI Control
Overview of WPF in light of Ribbon UI ControlOverview of WPF in light of Ribbon UI Control
Overview of WPF in light of Ribbon UI Control
Abhishek Sur
 
Linq to xml
Linq to xmlLinq to xml
Linq to xml
Mickey
 
Drupal 8 meets to symphony
Drupal 8 meets to symphonyDrupal 8 meets to symphony
Drupal 8 meets to symphony
Brahampal Singh
 
SPRING 1. overview
SPRING 1. overviewSPRING 1. overview
SPRING 1. overview
Francesco Ierna
 
Windows Kernel-
Windows Kernel-Windows Kernel-
Windows Kernel-
Parth Desai
 
Standing on the Shoulders of Giants – The Kotti Web Application Framework
Standing on the Shoulders of Giants – The Kotti Web Application FrameworkStanding on the Shoulders of Giants – The Kotti Web Application Framework
Standing on the Shoulders of Giants – The Kotti Web Application Framework
Don Disko
 
ознакомления с модулем Entity api
ознакомления с модулем Entity apiознакомления с модулем Entity api
ознакомления с модулем Entity api
DrupalCamp Kyiv Рысь
 
Kamil Kolodziejski_Structura-AWS.pptx
Kamil Kolodziejski_Structura-AWS.pptxKamil Kolodziejski_Structura-AWS.pptx
Kamil Kolodziejski_Structura-AWS.pptx
AWS Chicago
 
Cross-Platform Native Mobile Development with Eclipse
Cross-Platform Native Mobile Development with EclipseCross-Platform Native Mobile Development with Eclipse
Cross-Platform Native Mobile Development with Eclipse
Peter Friese
 
Android For Java Developers
Android For Java DevelopersAndroid For Java Developers
Android For Java Developers
Mike Wolfson
 
Entity Framework 4
Entity Framework 4Entity Framework 4
Entity Framework 4
richardrflores1
 
Fedora
FedoraFedora
L0036 - Creating Views and Editors
L0036 - Creating Views and EditorsL0036 - Creating Views and Editors
L0036 - Creating Views and Editors
Tonny Madsen
 

Similar to Quick Look for iOS (20)

WPF Concepts
WPF ConceptsWPF Concepts
WPF Concepts
 
Enterprise Library 2.0 Core Architecture
Enterprise Library 2.0 Core ArchitectureEnterprise Library 2.0 Core Architecture
Enterprise Library 2.0 Core Architecture
 
Developing on Windows 8
Developing on Windows 8Developing on Windows 8
Developing on Windows 8
 
Beyond Comments: How to Build an Awesome API Doc and Be a Better Person
Beyond Comments: How to Build an Awesome API Doc and Be a Better PersonBeyond Comments: How to Build an Awesome API Doc and Be a Better Person
Beyond Comments: How to Build an Awesome API Doc and Be a Better Person
 
Feed the Masses
Feed the MassesFeed the Masses
Feed the Masses
 
IntelliJ IDEA Architecture and Performance
IntelliJ IDEA Architecture and PerformanceIntelliJ IDEA Architecture and Performance
IntelliJ IDEA Architecture and Performance
 
iOS Course day 2
iOS Course day 2iOS Course day 2
iOS Course day 2
 
Overview of WPF in light of Ribbon UI Control
Overview of WPF in light of Ribbon UI ControlOverview of WPF in light of Ribbon UI Control
Overview of WPF in light of Ribbon UI Control
 
Linq to xml
Linq to xmlLinq to xml
Linq to xml
 
Drupal 8 meets to symphony
Drupal 8 meets to symphonyDrupal 8 meets to symphony
Drupal 8 meets to symphony
 
SPRING 1. overview
SPRING 1. overviewSPRING 1. overview
SPRING 1. overview
 
Windows Kernel-
Windows Kernel-Windows Kernel-
Windows Kernel-
 
Standing on the Shoulders of Giants – The Kotti Web Application Framework
Standing on the Shoulders of Giants – The Kotti Web Application FrameworkStanding on the Shoulders of Giants – The Kotti Web Application Framework
Standing on the Shoulders of Giants – The Kotti Web Application Framework
 
ознакомления с модулем Entity api
ознакомления с модулем Entity apiознакомления с модулем Entity api
ознакомления с модулем Entity api
 
Kamil Kolodziejski_Structura-AWS.pptx
Kamil Kolodziejski_Structura-AWS.pptxKamil Kolodziejski_Structura-AWS.pptx
Kamil Kolodziejski_Structura-AWS.pptx
 
Cross-Platform Native Mobile Development with Eclipse
Cross-Platform Native Mobile Development with EclipseCross-Platform Native Mobile Development with Eclipse
Cross-Platform Native Mobile Development with Eclipse
 
Android For Java Developers
Android For Java DevelopersAndroid For Java Developers
Android For Java Developers
 
Entity Framework 4
Entity Framework 4Entity Framework 4
Entity Framework 4
 
Fedora
FedoraFedora
Fedora
 
L0036 - Creating Views and Editors
L0036 - Creating Views and EditorsL0036 - Creating Views and Editors
L0036 - Creating Views and Editors
 

More from Robert Brown

High level concurrency
High level concurrencyHigh level concurrency
High level concurrency
Robert Brown
 
Data Source Combinators
Data Source CombinatorsData Source Combinators
Data Source Combinators
Robert Brown
 
Elixir
ElixirElixir
Elixir
Robert Brown
 
MVVM
MVVMMVVM
Reactive Cocoa
Reactive CocoaReactive Cocoa
Reactive Cocoa
Robert Brown
 
UIKit Dynamics
UIKit DynamicsUIKit Dynamics
UIKit Dynamics
Robert Brown
 
iOS State Preservation and Restoration
iOS State Preservation and RestorationiOS State Preservation and Restoration
iOS State Preservation and Restoration
Robert Brown
 
Anti-Patterns
Anti-PatternsAnti-Patterns
Anti-Patterns
Robert Brown
 
Pragmatic blocks
Pragmatic blocksPragmatic blocks
Pragmatic blocks
Robert Brown
 
Automatic Reference Counting
Automatic Reference CountingAutomatic Reference Counting
Automatic Reference Counting
Robert Brown
 
Grand Central Dispatch Design Patterns
Grand Central Dispatch Design PatternsGrand Central Dispatch Design Patterns
Grand Central Dispatch Design Patterns
Robert Brown
 
Grand Central Dispatch
Grand Central DispatchGrand Central Dispatch
Grand Central Dispatch
Robert Brown
 
Mac/iOS Design Patterns
Mac/iOS Design PatternsMac/iOS Design Patterns
Mac/iOS Design Patterns
Robert Brown
 
Core Data
Core DataCore Data
Core Data
Robert Brown
 

More from Robert Brown (14)

High level concurrency
High level concurrencyHigh level concurrency
High level concurrency
 
Data Source Combinators
Data Source CombinatorsData Source Combinators
Data Source Combinators
 
Elixir
ElixirElixir
Elixir
 
MVVM
MVVMMVVM
MVVM
 
Reactive Cocoa
Reactive CocoaReactive Cocoa
Reactive Cocoa
 
UIKit Dynamics
UIKit DynamicsUIKit Dynamics
UIKit Dynamics
 
iOS State Preservation and Restoration
iOS State Preservation and RestorationiOS State Preservation and Restoration
iOS State Preservation and Restoration
 
Anti-Patterns
Anti-PatternsAnti-Patterns
Anti-Patterns
 
Pragmatic blocks
Pragmatic blocksPragmatic blocks
Pragmatic blocks
 
Automatic Reference Counting
Automatic Reference CountingAutomatic Reference Counting
Automatic Reference Counting
 
Grand Central Dispatch Design Patterns
Grand Central Dispatch Design PatternsGrand Central Dispatch Design Patterns
Grand Central Dispatch Design Patterns
 
Grand Central Dispatch
Grand Central DispatchGrand Central Dispatch
Grand Central Dispatch
 
Mac/iOS Design Patterns
Mac/iOS Design PatternsMac/iOS Design Patterns
Mac/iOS Design Patterns
 
Core Data
Core DataCore Data
Core Data
 

Recently uploaded

How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
Neo4j
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
DianaGray10
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
Fwdays
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
Javier Junquera
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
Ivo Velitchkov
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Precisely
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
DianaGray10
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 

Recently uploaded (20)

How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 

Quick Look for iOS

  • 1. Quick Look for iOS By Robert Brown @robby_brown
  • 2. What is Quick Look? Previews all common files Includes AirPrint Available since iOS 4.0
  • 3. QLPreviewItem Protocol for previewing files (Required) -(NSURL)previewItemURL Must be a file URL (i.e. file://somefile.txt) Use [NSURL fileURLWithPath:somePath] (Optional) -(NSString)previewItemTitle NSURL conforms to QLPreviewItem
  • 4. QLPreviewController Subclass of UIViewController Can be pushed into view or presented modally Must have a data source May have a delegate
  • 5. QLPreviewController iWork Documents Text files (with supported UTI) Microsoft Office Documents (1997+) CSV RTF HTML PDF Images
  • 6. QLPreviewControllerDataSource Similar to UITableViewDataSource Tells how many QLPreviewItems it provides Returns a QLPreviewItem when asked
  • 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. 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. 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. 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. 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. Inter-app File Sharing Developer tip: Use mdls command on a file to see its UTI tree
  • 14. Demo
  • 15. Want to learn more? robsprogramknowledge.blogspot.com Document Interaction Programming Topics for iOS WWDC 2010 Session 106

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n