229 docmanager 03 d mu - apple inc. · pdf filenew files app cloud storage—file provider...
TRANSCRIPT
![Page 1: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/1.jpg)
#WWDC17
© 2017 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple.
Pau Sastre Miguel, Software Engineer Raffael Hannemann, Software Engineer Maxime Uzan, Software Engineer
•Building Great Document-based Apps • Session 229
App Frameworks
![Page 2: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/2.jpg)
![Page 3: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/3.jpg)
New Files App Cloud Storage—File provider
File provider extension for external cloud storage
Accessible from the Locations view
File Provider Enhancements Grand Ballroom A Friday 11:00AM
![Page 4: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/4.jpg)
New Files App iCloud Drive
File provider based
Shows files within the applicationcloud container
![Page 5: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/5.jpg)
Local storage
New Files App On my iPad/iPhone
![Page 6: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/6.jpg)
Local storage
Shows files inside the application container’s Documents folder
New Files App On my iPad/iPhone
![Page 7: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/7.jpg)
Local storage
Shows files inside the application container’s Documents folder
Configure the Info.plist in one of the following ways
New Files App On my iPad/iPhone
![Page 8: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/8.jpg)
Local storage
Shows files inside the application container’s Documents folder
Configure the Info.plist in one of the following ways UISupportsDocumentBrowser
New Files App On my iPad/iPhone
![Page 9: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/9.jpg)
Local storage
Shows files inside the application container’s Documents folder
Configure the Info.plist in one of the following ways UISupportsDocumentBrowserUIFileSharingEnabled + LSSupportsOpeningDocumentsInPlace
New Files App On my iPad/iPhone
![Page 10: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/10.jpg)
Keep the content clean
New Files App On my iPad/iPhone
![Page 11: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/11.jpg)
Keep the content clean
Content is not synced
New Files App On my iPad/iPhone
![Page 12: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/12.jpg)
Keep the content clean
Content is not synced
Included in iCloud Backup
New Files App On my iPad/iPhone
![Page 13: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/13.jpg)
New Files App Recents
Documents recently• Opened• Imported• Modified
![Page 14: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/14.jpg)
New Files App Recents
Documents recently• Opened• Imported• Modified
Documents organized by tags
![Page 15: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/15.jpg)
New Files App Recents
Documents recently• Opened• Imported• Modified
Documents organized by tags
Documents shared with others
![Page 16: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/16.jpg)
New Files App Tags
New tagging UI
![Page 17: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/17.jpg)
New Files App Tags
New tagging UI
File provider support
![Page 18: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/18.jpg)
New Files App Tags
New tagging UI
File provider support
Synced across iOS and macOS
![Page 19: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/19.jpg)
New Files App Recents Popover
Access recent documents for any app
![Page 20: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/20.jpg)
New Files App Recents Popover
Access recent documents for any app
Drag and Drop
![Page 21: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/21.jpg)
What about your app?
![Page 22: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/22.jpg)
Developer Requests
![Page 23: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/23.jpg)
Developer Requests
Unified UI for file browsing
![Page 24: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/24.jpg)
Developer Requests
Unified UI for file browsing
Access files from other app
![Page 25: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/25.jpg)
Developer Requests
Unified UI for file browsing
Access files from other app
Seamless access to other cloud providers
![Page 26: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/26.jpg)
Developer Requests
Unified UI for file browsing
Access files from other app
Seamless access to other cloud providers
Deep integration of custom document types
![Page 27: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/27.jpg)
•Document Browser API •Thumbnail Extension •Quick Look Preview Extension
![Page 28: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/28.jpg)
•Document Browser API •Thumbnail Extension •Quick Look Preview Extension
![Page 29: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/29.jpg)
Document Browser API
UIDocumentBrowserViewController
NEW
![Page 30: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/30.jpg)
Document Browser API
UIDocumentBrowserViewController
New Xcode template
NEW
![Page 31: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/31.jpg)
Document Browser API
UIDocumentBrowserViewController
New Xcode template
Improvements on UIDocumentPickerViewController
NEW
![Page 32: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/32.jpg)
UIDocumentBrowserViewController
Same feature set as Files
NEW
![Page 33: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/33.jpg)
UIDocumentBrowserViewController
Same feature set as Files
Integration with other cloud storage providers
NEW
![Page 34: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/34.jpg)
UIDocumentBrowserViewController
Same feature set as Files
Integration with other cloud storage providers
Customizable appearance
NEW
![Page 35: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/35.jpg)
UIDocumentBrowserViewController
Same feature set as Files
Integration with other cloud storage providers
Customizable appearance
Recents popover
NEW
![Page 36: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/36.jpg)
Automatic Spotlight file indexing for metadata
You still need to use CoreSpotlight to index the content
De-duplication via the CSSearchableItem contentURL
UIDocumentBrowserViewController Spotlight support
NEW
What’s New in Core Spotlight for iOS and macOS Grand Ballroom B Thursday 4:10PM
![Page 37: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/37.jpg)
UIDocumentBrowserViewController Privacy model
Can only access files within its container
![Page 38: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/38.jpg)
UIDocumentBrowserViewController Privacy model
Can only access files within its container
Can import or create new files in the default save location
![Page 39: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/39.jpg)
UIDocumentBrowserViewController Privacy model
Can only access files within its container
Can import or create new files in the default save location
Your app can gain access to documents via user interaction • Documents in other application containers • Documents stored in any cloud provider
![Page 40: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/40.jpg)
UIDocumentPickerViewController New look and feel
NEW
![Page 41: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/41.jpg)
UIDocumentPickerViewController Picking files
NEW
picker.allowsMultipleSelection = true
![Page 42: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/42.jpg)
UIDocumentPickerViewController Picking files
NEW
picker.allowsMultipleSelection = true
public func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentAt url: URL)
![Page 43: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/43.jpg)
UIDocumentPickerViewController Picking files
NEW
picker.allowsMultipleSelection = true
public func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentAt url: URL)
public func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL])
![Page 44: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/44.jpg)
•UIDocumentMenuViewController
![Page 45: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/45.jpg)
•UIDocumentBrowserViewController •Getting Started
NEW
![Page 46: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/46.jpg)
Getting started Info.plist
UISupportsDocumentBrowser
![Page 47: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/47.jpg)
Getting started Info.plist
UISupportsDocumentBrowser
Declare the supported content types
![Page 48: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/48.jpg)
Getting started UIDocumentBrowserViewController
Root View Controller
![Page 49: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/49.jpg)
Appearance
![Page 50: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/50.jpg)
Appearance
browserController.browserInterfaceStyle = .dark // .white or .light browserController.view.tintColor = .orange // any UIColor
![Page 51: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/51.jpg)
•Opening Documents
![Page 52: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/52.jpg)
User taps on a document
•Opening Documents
![Page 53: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/53.jpg)
User taps on a documentFetch/Download the
document
•Opening Documents
![Page 54: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/54.jpg)
User taps on a documentFetch/Download the
document
Extend access
•Opening Documents
![Page 55: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/55.jpg)
Did pick documents
User taps on a documentFetch/Download the
document
Extend access
•Opening Documents
![Page 56: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/56.jpg)
Did pick documents
User taps on a documentFetch/Download the
document
Extend access
Load and present
•Opening Documents
![Page 57: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/57.jpg)
Persistent access to the file URL
Opening Documents
![Page 58: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/58.jpg)
Persistent access to the file URL
Use Bookmarks for state restoration
Opening Documents
![Page 59: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/59.jpg)
Persistent access to the file URL
Use Bookmarks for state restoration
Opening Documents
func documentBrowser(_ controller: UIDocumentBrowserViewController, didPickDocumentURLs documentURLs: [URL]) { present(documentURLs: documentURLs) }
![Page 60: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/60.jpg)
browserController.allowsPickingMultipleItems = true
Opening Documents
![Page 61: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/61.jpg)
Creating New Documents
![Page 62: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/62.jpg)
Creating New Documents
User requests new document
![Page 63: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/63.jpg)
Creating New Documents
User requests new documentPrepare new document
![Page 64: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/64.jpg)
Creating New Documents
User requests new document
Import Operation
Prepare new document
Import handler
![Page 65: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/65.jpg)
Creating New Documents
User requests new document
Import Operation
Succeed
Prepare new document
Import handler
![Page 66: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/66.jpg)
Creating New Documents
User requests new document
Import Operation
Succeed
Load and present
Prepare new document
Import handler
![Page 67: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/67.jpg)
Creating New Documents
User requests new document
Import Operation
Fail
Prepare new document
Import handler
![Page 68: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/68.jpg)
func documentBrowser(_ controller: UIDocumentBrowserViewController, didRequestDocumentCreationWithHandler importHandler: @escaping (URL?, UIDocumentBrowserViewController.ImportMode) -> Swift.Void) {
}
![Page 69: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/69.jpg)
func documentBrowser(_ controller: UIDocumentBrowserViewController, didRequestDocumentCreationWithHandler importHandler: @escaping (URL?, UIDocumentBrowserViewController.ImportMode) -> Swift.Void) { presentTemplateChooser(completion: { (templateURL, canceled) in
}) }
![Page 70: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/70.jpg)
func documentBrowser(_ controller: UIDocumentBrowserViewController, didRequestDocumentCreationWithHandler importHandler: @escaping (URL?, UIDocumentBrowserViewController.ImportMode) -> Swift.Void) { presentTemplateChooser(completion: { (templateURL, canceled) in if let templateURL = templateURL { importHandler(templateURL, .copy) } else { importHandler(nil, .none) } }) }
![Page 71: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/71.jpg)
func documentBrowser(_ controller: UIDocumentBrowserViewController, didRequestDocumentCreationWithHandler importHandler: @escaping (URL?, UIDocumentBrowserViewController.ImportMode) -> Swift.Void) { presentTemplateChooser(completion: { (templateURL, canceled) in if let templateURL = templateURL { importHandler(templateURL, .copy) } else { importHandler(nil, .none) } }) } func documentBrowser(_ controller: UIDocumentBrowserViewController, didImportDocumentAt sourceURL: URL, toDestinationURL destinationURL: URL) { present(documentURL: destinationURL) }
![Page 72: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/72.jpg)
func documentBrowser(_ controller: UIDocumentBrowserViewController, didRequestDocumentCreationWithHandler importHandler: @escaping (URL?, UIDocumentBrowserViewController.ImportMode) -> Swift.Void) { presentTemplateChooser(completion: { (templateURL, canceled) in if let templateURL = templateURL { importHandler(templateURL, .copy) } else { importHandler(nil, .none) } }) } func documentBrowser(_ controller: UIDocumentBrowserViewController, didImportDocumentAt sourceURL: URL, toDestinationURL destinationURL: URL) { present(documentURL: destinationURL) } func documentBrowser(_ controller: UIDocumentBrowserViewController, failedToImportDocumentAt documentURL: URL, error: Error?) { presentError(error) }
![Page 73: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/73.jpg)
UIDocument
NSFileCoordinator
NSFilePresenter
Security-scoped
Operating with Documents
Building Document Based Apps WWDC 2015
![Page 74: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/74.jpg)
UIDocument
NSFileCoordinator
NSFilePresenter
Security-scoped
Autosave
Operating with Documents
Building Document Based Apps WWDC 2015
![Page 75: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/75.jpg)
•Demo
Raffael Hannemann
![Page 76: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/76.jpg)
![Page 77: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/77.jpg)
![Page 78: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/78.jpg)
Demo
![Page 79: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/79.jpg)
Demo
Configure the project
![Page 80: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/80.jpg)
Demo
Configure the project
Create new documents
![Page 81: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/81.jpg)
Demo
Configure the project
Create new documents
Open documents
![Page 82: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/82.jpg)
Demo
Configure the project
Create new documents
Open documents
Customize the style
![Page 83: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/83.jpg)
•UIDocumentBrowserViewController •Providing a great experience
NEW
![Page 84: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/84.jpg)
•Open-in-place •Custom actions •Opening transition
![Page 85: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/85.jpg)
Open files without copying
Open-in-place
![Page 86: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/86.jpg)
Open files without copying
Any application can modify a file in your container
Open-in-place
![Page 87: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/87.jpg)
func application(_ app: UIApplication, open inputURL: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
}
![Page 88: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/88.jpg)
func application(_ app: UIApplication, open inputURL: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool { guard inputURL.isFileURL else { return false } browserController.revealDocument(at: inputURL, importIfNeeded: true) { (revealedDocumentURL, error) in
} return true }
![Page 89: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/89.jpg)
func application(_ app: UIApplication, open inputURL: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool { guard inputURL.isFileURL else { return false } browserController.revealDocument(at: inputURL, importIfNeeded: true) { (revealedDocumentURL, error) in if let revealedDocumentURL = revealedDocumentURL { present(documentURL: revealedDocumentURL) } else if let error = error { presentError(error) } } return true }
![Page 90: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/90.jpg)
•Custom Actions UIDocumentBrowserAction
![Page 91: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/91.jpg)
•Custom Actions UIDocumentBrowserAction
let action = UIDocumentBrowserAction(identifier: “com.example.particles.export-gif", localizedTitle: “Export as GIF", availability: [.menu, .navigationBar]) { urls in shareGIF(urls) } action.supportedContentTypes = ["com.example.particles"] action.supportsMultipleItems = false
browserController.customActions = [action]
![Page 92: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/92.jpg)
•Custom Actions UIBarButtonItem
![Page 93: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/93.jpg)
•Custom Actions UIBarButtonItem
let settingsButton = UIBarButtonItem(title: "Settings", style: .plain, target: self, action: #selector(showSettings))
browserController.additionalTrailingNavigationBarButtonItems = [settingsButton]
![Page 94: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/94.jpg)
•UIActivityViewController
![Page 95: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/95.jpg)
•UIActivityViewController
Fully control UIActivityViewController
![Page 96: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/96.jpg)
•UIActivityViewController
Fully control UIActivityViewController
Add custom activities
![Page 97: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/97.jpg)
func documentBrowser(_ controller: UIDocumentBrowserViewController, applicationActivitiesForDocumentURLs documentURLs: [URL]) -> [UIActivity] { return [ExportGIFActivity()]}
![Page 98: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/98.jpg)
func documentBrowser(_ controller: UIDocumentBrowserViewController, applicationActivitiesForDocumentURLs documentURLs: [URL]) -> [UIActivity] { return [ExportGIFActivity()]} func documentBrowser(_ controller: UIDocumentBrowserViewController, willPresent activityViewController: UIActivityViewController) { activityViewController.excludedActivityTypes = [.print]}
![Page 99: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/99.jpg)
Opening Transition UIDocumentBrowserTransitionController
![Page 100: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/100.jpg)
Loading progress indicator NSProgress
Zoom animation UIViewControllerAnimatedTransitioning
Opening Transition UIDocumentBrowserTransitionController
![Page 101: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/101.jpg)
•Opening Transition UIDocumentBrowserTransitionController
Your Application
TransitionController
![Page 102: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/102.jpg)
•Opening Transition UIDocumentBrowserTransitionController
Your Application
TransitionController
Did pick
![Page 103: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/103.jpg)
•Opening Transition UIDocumentBrowserTransitionController
Your Application
TransitionController
Did pick Load content
![Page 104: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/104.jpg)
•Opening Transition UIDocumentBrowserTransitionController
Update progress
Your Application
TransitionController
Did pick 0% 100%Load content
![Page 105: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/105.jpg)
•Opening Transition UIDocumentBrowserTransitionController
Update progress
Your Application
TransitionController
Did pick 0% 100%Load content Present content
Animate
![Page 106: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/106.jpg)
var transitionController: UIDocumentBrowserTransitionController? = nil
func documentBrowser(_ controller: UIDocumentBrowserViewController, didPickDocumentURLs documentURLs: [URL]) { if let documentURL = documentURLs.first {
} }
![Page 107: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/107.jpg)
var transitionController: UIDocumentBrowserTransitionController? = nil
func documentBrowser(_ controller: UIDocumentBrowserViewController, didPickDocumentURLs documentURLs: [URL]) { if let documentURL = documentURLs.first {
let progress = Progress(totalUnitCount: 0) transitionController = controller.transitionController(forDocumentURL: documentURL) transitionController?.loadingProgress = progress
} }
![Page 108: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/108.jpg)
var transitionController: UIDocumentBrowserTransitionController? = nil
func documentBrowser(_ controller: UIDocumentBrowserViewController, didPickDocumentURLs documentURLs: [URL]) { if let documentURL = documentURLs.first {
let progress = Progress(totalUnitCount: 0) transitionController = controller.transitionController(forDocumentURL: documentURL) transitionController?.loadingProgress = progress loadDocument(documentURL: documentURL, updateProgress: progress) { present(documentURL: documentURL) }) } }
![Page 109: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/109.jpg)
// UIViewControllerTransitioningDelegate
func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? { return transitionController}
func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { return transitionController}
![Page 110: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/110.jpg)
•Demo
Raffael Hannemann, Software Engineer
![Page 111: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/111.jpg)
Demo
![Page 112: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/112.jpg)
Demo
Open-in-place
![Page 113: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/113.jpg)
Demo
Open-in-place
Custom actions
![Page 114: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/114.jpg)
Demo
Open-in-place
Custom actions
Zoom transition
![Page 115: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/115.jpg)
Maxime Uzan, Software Engineer
•Document Browser API •Thumbnail Extension •Quick Look Preview Extension
NEW
![Page 116: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/116.jpg)
![Page 117: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/117.jpg)
![Page 118: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/118.jpg)
Providing Thumbnails Through UIDocument
![Page 119: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/119.jpg)
Providing Thumbnails Through UIDocument
Return the thumbnail from your subclass of UIDocument
![Page 120: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/120.jpg)
Providing Thumbnails Through UIDocument
Return the thumbnail from your subclass of UIDocument
Only for files created by your application
![Page 121: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/121.jpg)
Providing Thumbnails Through UIDocument
Return the thumbnail from your subclass of UIDocument
Only for files created by your application
Good performance, file is already loaded when setting the thumbnail
![Page 122: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/122.jpg)
Providing Thumbnails Through UIDocument
override func fileAttributesToWrite(to url: URL, for saveOperation: UIDocumentSaveOperation) throws -> [AnyHashable : Any] {
let thumbnail = thumbnailForDocument(at: url) return [ URLResourceKey.hasHiddenExtensionKey: true, URLResourceKey.thumbnailDictionaryKey: [ URLThumbnailDictionaryItem.NSThumbnail1024x1024SizeKey: thumbnail ] ] }
![Page 123: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/123.jpg)
Providing Thumbnails Thumbnail Extension
![Page 124: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/124.jpg)
Providing Thumbnails Thumbnail Extension
System-wide
![Page 125: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/125.jpg)
Providing Thumbnails Thumbnail Extension
System-wide
Works with all cloud vendors
![Page 126: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/126.jpg)
Providing Thumbnails Thumbnail Extension
System-wide
Works with all cloud vendors
Part of the QuickLook framework
![Page 127: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/127.jpg)
Providing Thumbnails Thumbnail Extension—how it works
![Page 128: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/128.jpg)
Providing Thumbnails Thumbnail Extension—how it works
Requests thumbnail
![Page 129: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/129.jpg)
Providing Thumbnails Thumbnail Extension—how it works
Finds your extensionRequests thumbnail
![Page 130: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/130.jpg)
Providing Thumbnails Thumbnail Extension—how it works
Finds your extension
Forwards thumbnail request
Requests thumbnail
![Page 131: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/131.jpg)
Providing Thumbnails Thumbnail Extension—how it works
Finds your extension
Forwards thumbnail request
Requests thumbnail
Generates thumbnail
![Page 132: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/132.jpg)
Providing Thumbnails Thumbnail Extension—how it works
Finds your extension
Forwards thumbnail request
Requests thumbnail
Generates thumbnail
Returns thumbnail
![Page 133: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/133.jpg)
Providing Thumbnails Thumbnail Extension—how it works
Finds your extension
Forwards thumbnail request
Requests thumbnail
Generates thumbnail
Returns thumbnailForwards thumbnail
![Page 134: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/134.jpg)
Providing Thumbnails Thumbnail Extension—how it works
Finds your extension
Forwards thumbnail request
Displays thumbnail
Requests thumbnail
Generates thumbnail
Returns thumbnailForwards thumbnail
![Page 135: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/135.jpg)
Thumbnail Extension Getting started—Xcode template
![Page 136: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/136.jpg)
Thumbnail Extension Getting started—Info.plist
![Page 137: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/137.jpg)
Thumbnail Extension Getting started—Info.plist
Add all supported UTIs to the QLSupportedContentTypes array
![Page 138: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/138.jpg)
Thumbnail Extension Getting started—Info.plist
Add all supported UTIs to the QLSupportedContentTypes array• You can only provide thumbnails for UTIs you own and export
![Page 139: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/139.jpg)
Thumbnail Extension Getting started—Info.plist
Add all supported UTIs to the QLSupportedContentTypes array• You can only provide thumbnails for UTIs you own and export • iOS will check for strict UTI equality, not conformance
![Page 140: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/140.jpg)
Providing Thumbnails Drawing thumbnails
![Page 141: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/141.jpg)
QLFileThumbnailRequest
maximumSizefileURL scale
Providing Thumbnails Drawing thumbnails
![Page 142: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/142.jpg)
Providing Thumbnails Drawing thumbnails
QLThumbnailReply
Drawing Block
contextSize
QLFileThumbnailRequest
maximumSizefileURL scale
![Page 143: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/143.jpg)
Providing Thumbnails Drawing thumbnails
CGContext
maximumSize.width
max
imum
Size
.hei
ght
QLThumbnailReply
Drawing Block
contextSize
QLFileThumbnailRequest
maximumSizefileURL scale
![Page 144: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/144.jpg)
Providing Thumbnails Drawing thumbnails
CGContext
maximumSize.width
max
imum
Size
.hei
ght
QLThumbnailReply
Drawing Block
contextSize
QLFileThumbnailRequest
maximumSizefileURL scale
![Page 145: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/145.jpg)
Providing Thumbnails Drawing thumbnails
CGContext
maximumSize.width
max
imum
Size
.hei
ght
maximumSize.width
QLThumbnailReply
Drawing Block
contextSize
QLFileThumbnailRequest
maximumSizefileURL scale
![Page 146: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/146.jpg)
cont
extS
ize.
heig
ht
Providing Thumbnails Drawing thumbnails
contextSize.width
CGContext
QLThumbnailReply
Drawing Block
contextSize
QLFileThumbnailRequest
maximumSizefileURL scale
![Page 147: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/147.jpg)
Providing Thumbnails Drawing thumbnails
CGContext
QLThumbnailReply
Drawing Block
contextSize
QLFileThumbnailRequest
maximumSizefileURL scale
![Page 148: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/148.jpg)
QLThumbnailReply
Drawing Block
contextSize
QLFileThumbnailRequest
maximumSizefileURL scale
Providing Thumbnails Drawing thumbnails
CGContext
![Page 149: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/149.jpg)
QLThumbnailReply
Drawing Block
contextSize
QLFileThumbnailRequest
maximumSizefileURL scale
CGContext
Providing Thumbnails Drawing thumbnails
![Page 150: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/150.jpg)
Providing Thumbnails Image file URL
![Page 151: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/151.jpg)
QLThumbnailReply
Providing Thumbnails Image file URL
imageFileURL
QLFileThumbnailRequest
maximumSizefileURL scale
![Page 152: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/152.jpg)
override func provideThumbnail(for request: QLFileThumbnailRequest, _ handler: @escaping (QLThumbnailReply?, Error?) -> Void) { let fileURL = request.fileURL let maximumSize = request.maximumSize let scale = request.scale let contextSize = contextSizeForFile(at: fileURL, maximumSize: maximumSize, scale: scale) let drawingBlock: (CGContext) -> Bool = { context in let success = self.drawThumbnailForFile(at: fileURL, contextSize: contextSize, context: context) return success } let reply = QLThumbnailReply(contextSize: contextSize, drawing: drawingBlock) handler(reply, nil) }
![Page 153: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/153.jpg)
override func provideThumbnail(for request: QLFileThumbnailRequest, _ handler: @escaping (QLThumbnailReply?, Error?) -> Void) { let fileURL = request.fileURL let maximumSize = request.maximumSize let scale = request.scale let contextSize = contextSizeForFile(at: fileURL, maximumSize: maximumSize, scale: scale) let drawingBlock: (CGContext) -> Bool = { context in let success = self.drawThumbnailForFile(at: fileURL, contextSize: contextSize, context: context) return success } let reply = QLThumbnailReply(contextSize: contextSize, drawing: drawingBlock) handler(reply, nil) }
![Page 154: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/154.jpg)
override func provideThumbnail(for request: QLFileThumbnailRequest, _ handler: @escaping (QLThumbnailReply?, Error?) -> Void) { let fileURL = request.fileURL let maximumSize = request.maximumSize let scale = request.scale let contextSize = contextSizeForFile(at: fileURL, maximumSize: maximumSize, scale: scale) let drawingBlock: (CGContext) -> Bool = { context in let success = self.drawThumbnailForFile(at: fileURL, contextSize: contextSize, context: context) return success } let reply = QLThumbnailReply(contextSize: contextSize, drawing: drawingBlock) handler(reply, nil) }
![Page 155: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/155.jpg)
override func provideThumbnail(for request: QLFileThumbnailRequest, _ handler: @escaping (QLThumbnailReply?, Error?) -> Void) { let fileURL = request.fileURL let maximumSize = request.maximumSize let scale = request.scale let contextSize = contextSizeForFile(at: fileURL, maximumSize: maximumSize, scale: scale) let drawingBlock: (CGContext) -> Bool = { context in let success = self.drawThumbnailForFile(at: fileURL, contextSize: contextSize, context: context) return success } let reply = QLThumbnailReply(contextSize: contextSize, drawing: drawingBlock) handler(reply, nil) }
![Page 156: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/156.jpg)
override func provideThumbnail(for request: QLFileThumbnailRequest, _ handler: @escaping (QLThumbnailReply?, Error?) -> Void) { let fileURL = request.fileURL let maximumSize = request.maximumSize let scale = request.scale let contextSize = contextSizeForFile(at: fileURL, maximumSize: maximumSize, scale: scale) let drawingBlock: (CGContext) -> Bool = { context in let success = self.drawThumbnailForFile(at: fileURL, contextSize: contextSize, context: context) return success } let reply = QLThumbnailReply(contextSize: contextSize, drawing: drawingBlock) handler(reply, nil) }
![Page 157: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/157.jpg)
Thumbnail Extension Image file URL
![Page 158: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/158.jpg)
Thumbnail Extension Image file URL
override func provideThumbnail(for request: QLFileThumbnailRequest, _ handler: @escaping (QLThumbnailReply?, Error?) -> Void) { if let imageFileURL = Bundle.main.url(forResource: "image", withExtension: "jpg") { handler(QLThumbnailReply(imageFileURL: imageFileURL), nil) } else { handler(nil, nil) } }
![Page 159: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/159.jpg)
Thumbnail Extension Testing
![Page 160: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/160.jpg)
•Document Browser API •Thumbnail Extension •Quick Look Preview Extension
NEW
![Page 161: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/161.jpg)
![Page 162: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/162.jpg)
![Page 163: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/163.jpg)
Quick Look Preview Extension Providing system-wide Quick Look previews
![Page 164: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/164.jpg)
Quick Look Preview Extension Providing system-wide Quick Look previews
System-wide
![Page 165: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/165.jpg)
Quick Look Preview Extension Providing system-wide Quick Look previews
System-wide• Applications using Quick Look
![Page 166: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/166.jpg)
Quick Look Preview Extension Providing system-wide Quick Look previews
System-wide• Applications using Quick Look• Spotlight when peeking on results
![Page 167: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/167.jpg)
Quick Look Preview Extension Providing system-wide Quick Look previews
System-wide• Applications using Quick Look• Spotlight when peeking on results
Full Quick Look experience
![Page 168: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/168.jpg)
Quick Look Preview Extension Providing system-wide Quick Look previews
System-wide• Applications using Quick Look• Spotlight when peeking on results
Full Quick Look experience• Previewed in QLPreviewController
![Page 169: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/169.jpg)
Quick Look Preview Extension Providing system-wide Quick Look previews
System-wide• Applications using Quick Look• Spotlight when peeking on results
Full Quick Look experience• Previewed in QLPreviewController• Loading spinner
![Page 170: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/170.jpg)
Quick Look Preview Extension Providing system-wide Quick Look previews
System-wide• Applications using Quick Look• Spotlight when peeking on results
Full Quick Look experience• Previewed in QLPreviewController• Loading spinner
![Page 171: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/171.jpg)
Quick Look Preview Extension Providing system-wide Quick Look previews
Requests preview
System-wide• Applications using Quick Look• Spotlight when peeking on results
Full Quick Look experience• Previewed in QLPreviewController• Loading spinner
![Page 172: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/172.jpg)
Quick Look Preview Extension Providing system-wide Quick Look previews
Generates preview
Requests preview
System-wide• Applications using Quick Look• Spotlight when peeking on results
Full Quick Look experience• Previewed in QLPreviewController• Loading spinner
![Page 173: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/173.jpg)
Quick Look Preview Extension Providing system-wide Quick Look previews
Generates preview
Requests preview
(Loading spinner)
System-wide• Applications using Quick Look• Spotlight when peeking on results
Full Quick Look experience• Previewed in QLPreviewController• Loading spinner
![Page 174: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/174.jpg)
Quick Look Preview Extension Providing system-wide Quick Look previews
Generates preview
Call handler
Requests preview
(Loading spinner)
System-wide• Applications using Quick Look• Spotlight when peeking on results
Full Quick Look experience• Previewed in QLPreviewController• Loading spinner
![Page 175: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/175.jpg)
Quick Look Preview Extension Providing system-wide Quick Look previews
Generates preview
Call handler
Requests preview
Displays preview
(Loading spinner)
System-wide• Applications using Quick Look• Spotlight when peeking on results
Full Quick Look experience• Previewed in QLPreviewController• Loading spinner
![Page 176: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/176.jpg)
Quick Look Preview Extension Getting started—Xcode template
![Page 177: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/177.jpg)
Quick Look Preview Extension Getting started—Info.plist
![Page 178: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/178.jpg)
Quick Look Preview Extension Getting started—Info.plist
Add all supported UTIs to the QLSupportedContentTypes array
![Page 179: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/179.jpg)
Quick Look Preview Extension Getting started—Info.plist
Add all supported UTIs to the QLSupportedContentTypes array• You can only provide previews for UTIs you own and export
![Page 180: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/180.jpg)
Quick Look Preview Extension Getting started—Info.plist
Add all supported UTIs to the QLSupportedContentTypes array• You can only provide previews for UTIs you own and export • iOS will check for UTI equality, not conformance
![Page 181: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/181.jpg)
Quick Look Preview Extension Getting started—Info.plist
Add all supported UTIs to the QLSupportedContentTypes array• You can only provide previews for UTIs you own and export • iOS will check for UTI equality, not conformance
Set QLSupportsSearchableItems to YES if you want to provide previews for Spotlight items indexed by your application
![Page 182: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/182.jpg)
Quick Look Preview Extension Providing File previews
![Page 183: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/183.jpg)
Quick Look Preview Extension Providing File previews
func preparePreviewOfFile(at url: URL, completionHandler handler: @escaping (Error?) -> Void) { // Load the preview and call the completion handler asynchronously when ready. loadPreviewOfFile(at: url, completionHandler: handler)}
![Page 184: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/184.jpg)
Quick Look Preview Extension Providing Spotlight previews
![Page 185: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/185.jpg)
Quick Look Preview Extension Providing Spotlight previews
func preparePreviewOfSearchableItem(identifier: String, queryString: String?, completionHandler handler: @escaping (Error?) -> Void) { // Load the preview and call the completion handler asynchronously when ready. loadPreviewOfSearchableItem(identifier: identifier, queryString: queryString, completionHandler: handler)}
![Page 186: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/186.jpg)
Quick Look Preview Extension Testing
![Page 187: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/187.jpg)
Quick Look Preview Extension Testing
Any application that uses Quick Look
Spotlight, by peeking on a result
![Page 188: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/188.jpg)
Quick Look Preview Extension Testing
Any application that uses Quick Look
Spotlight, by peeking on a result
![Page 189: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/189.jpg)
Thumbnails and Preview Extensions Performance recommendations
![Page 190: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/190.jpg)
Thumbnails and Preview Extensions Performance recommendations
Be fast!
![Page 191: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/191.jpg)
Thumbnails and Preview Extensions Performance recommendations
Be fast!• Drawing thumbnails should be quick
![Page 192: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/192.jpg)
Thumbnails and Preview Extensions Performance recommendations
Be fast!• Drawing thumbnails should be quick• Users expect to see a preview quickly after opening a file
![Page 193: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/193.jpg)
Thumbnails and Preview Extensions Performance recommendations
Be fast!• Drawing thumbnails should be quick• Users expect to see a preview quickly after opening a file• No background job after calling the completion handler
![Page 194: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/194.jpg)
Thumbnails and Preview Extensions Performance recommendations
Be fast!• Drawing thumbnails should be quick• Users expect to see a preview quickly after opening a file• No background job after calling the completion handler
Memory is limited
![Page 195: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/195.jpg)
Thumbnails and Preview Extensions Performance recommendations
Be fast!• Drawing thumbnails should be quick• Users expect to see a preview quickly after opening a file• No background job after calling the completion handler
Memory is limited• Keep your extension lean—link with bare minimum libraries/frameworks
![Page 196: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/196.jpg)
Thumbnails and Preview Extensions Performance recommendations
Be fast!• Drawing thumbnails should be quick• Users expect to see a preview quickly after opening a file• No background job after calling the completion handler
Memory is limited• Keep your extension lean—link with bare minimum libraries/frameworks• Check for leaks
![Page 197: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/197.jpg)
•Document Browser API •Thumbnail Extension •Quick Look Preview Extension
![Page 198: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/198.jpg)
Developer Requests
Unified UI for file browsing
Access files from other applications
Seamless access to other Cloud Providers
Deep integration of custom document types
![Page 199: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/199.jpg)
Developer Requests
Unified UI for file browsing
Access files from other applications
Seamless access to other Cloud Providers
Deep integration of custom document types
![Page 200: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/200.jpg)
Developer Requests
Unified UI for file browsing
Access files from other applications
Seamless access to other Cloud Providers
Deep integration of custom document types
![Page 201: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/201.jpg)
Developer Requests
Unified UI for file browsing
Access files from other applications
Seamless access to other Cloud Providers
Deep integration of custom document types
![Page 202: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/202.jpg)
Developer Requests
Unified UI for file browsing
Access files from other applications
Seamless access to other Cloud Providers
Deep integration of custom document types
![Page 203: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/203.jpg)
More Informationhttps://developer.apple.com/wwdc17/229
![Page 204: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/204.jpg)
Related Sessions
Building Document-based Apps WWDC 2015
Introducing Drag and Drop WWDC 2017
What’s New in Core Spotlight for iOS and macOS Grand Ballroom B Thursday 4:10PM
File Provider Enhancements Grand Ballroom A Friday 11:00AM
![Page 205: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/205.jpg)
Labs
Document Browser Lab Technology Lab B Thu 3:10PM-6:00PM
File Providers and Document Browser Lab Technology Lab H Fri 1:00PM-4:00PM
![Page 206: 229 DocManager 03 D MU - Apple Inc. · PDF fileNew Files App Cloud Storage—File provider File provider extension for external cloud storage Accessible from the Locations view File](https://reader031.vdocuments.us/reader031/viewer/2022012323/5a786e627f8b9aa2448bd6d1/html5/thumbnails/206.jpg)