SlideShare une entreprise Scribd logo
1  sur  15
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

Contenu connexe

Similaire à Quick Look for iOS

Enterprise Library 2.0 Core Architecture
Enterprise Library 2.0 Core ArchitectureEnterprise Library 2.0 Core Architecture
Enterprise Library 2.0 Core Architecturemcgurk
 
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 PersonAlek Davis
 
Feed the Masses
Feed the MassesFeed the Masses
Feed the Massespbugni
 
IntelliJ IDEA Architecture and Performance
IntelliJ IDEA Architecture and PerformanceIntelliJ IDEA Architecture and Performance
IntelliJ IDEA Architecture and Performanceintelliyole
 
iOS Course day 2
iOS Course day 2iOS Course day 2
iOS Course day 2Rich 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 ControlAbhishek Sur
 
Linq to xml
Linq to xmlLinq to xml
Linq to xmlMickey
 
Drupal 8 meets to symphony
Drupal 8 meets to symphonyDrupal 8 meets to symphony
Drupal 8 meets to symphonyBrahampal Singh
 
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 FrameworkDon Disko
 
ознакомления с модулем Entity api
ознакомления с модулем Entity apiознакомления с модулем Entity api
ознакомления с модулем Entity apiDrupalCamp Kyiv Рысь
 
Kamil Kolodziejski_Structura-AWS.pptx
Kamil Kolodziejski_Structura-AWS.pptxKamil Kolodziejski_Structura-AWS.pptx
Kamil Kolodziejski_Structura-AWS.pptxAWS 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 EclipsePeter Friese
 
Android For Java Developers
Android For Java DevelopersAndroid For Java Developers
Android For Java DevelopersMike Wolfson
 
L0036 - Creating Views and Editors
L0036 - Creating Views and EditorsL0036 - Creating Views and Editors
L0036 - Creating Views and EditorsTonny Madsen
 

Similaire à 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
 

Plus de Robert Brown

High level concurrency
High level concurrencyHigh level concurrency
High level concurrencyRobert Brown
 
Data Source Combinators
Data Source CombinatorsData Source Combinators
Data Source CombinatorsRobert Brown
 
iOS State Preservation and Restoration
iOS State Preservation and RestorationiOS State Preservation and Restoration
iOS State Preservation and RestorationRobert Brown
 
Automatic Reference Counting
Automatic Reference CountingAutomatic Reference Counting
Automatic Reference CountingRobert Brown
 
Grand Central Dispatch Design Patterns
Grand Central Dispatch Design PatternsGrand Central Dispatch Design Patterns
Grand Central Dispatch Design PatternsRobert Brown
 
Grand Central Dispatch
Grand Central DispatchGrand Central Dispatch
Grand Central DispatchRobert Brown
 
Mac/iOS Design Patterns
Mac/iOS Design PatternsMac/iOS Design Patterns
Mac/iOS Design PatternsRobert Brown
 

Plus de 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
 

Dernier

New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 

Dernier (20)

New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 

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

Notes de l'éditeur

  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