Cloud Documents in Your Application€¦ · Building a modern document-based application Session...
Transcript of Cloud Documents in Your Application€¦ · Building a modern document-based application Session...
![Page 1: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/1.jpg)
© 2014 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple.
#WWDC14
Cloud Documents in Your ApplicationBuilding a modern document-based application
Session 234 Mike Hess Software Engineer
Frameworks
!
Johannes Fortmann Software Engineer
![Page 2: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/2.jpg)
Changes to iCloud
![Page 3: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/3.jpg)
Changes to iCloud
iCloud daemon rewritten on top of CloudKit
![Page 4: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/4.jpg)
Changes to iCloud
iCloud daemon rewritten on top of CloudKit
Windows support
![Page 5: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/5.jpg)
Changes to iCloud
iCloud daemon rewritten on top of CloudKit
Windows support
iCloud folder in Finder
![Page 6: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/6.jpg)
Changes to iCloud
iCloud daemon rewritten on top of CloudKit
Windows support
iCloud folder in Finder
Access to iCloud folder on iOS
![Page 7: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/7.jpg)
Agenda
![Page 8: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/8.jpg)
Agenda
Document access
![Page 9: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/9.jpg)
Agenda
Document access
Document discovery
![Page 10: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/10.jpg)
Agenda
Document access
Document discovery
Displaying thumbnails in your UI
![Page 11: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/11.jpg)
Agenda
Document access
Document discovery
Displaying thumbnails in your UI
Accessing documents outside your iCloud container
![Page 12: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/12.jpg)
Agenda
Document access
Document discovery
Displaying thumbnails in your UI
Accessing documents outside your iCloud container
Providing document storage to other apps
![Page 13: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/13.jpg)
Documents in iCloudWhat is a document anyway?
![Page 14: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/14.jpg)
Documents in iCloudWhat is a document anyway?
A standalone entity, understood as such by the user
![Page 15: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/15.jpg)
Documents in iCloudWhat is a document anyway?
A standalone entity, understood as such by the user
User might want to exchange (e.g., move it, modify it, send it via email)
![Page 16: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/16.jpg)
Documents in iCloudWhat is a document anyway?
A standalone entity, understood as such by the user
User might want to exchange (e.g., move it, modify it, send it via email)
![Page 17: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/17.jpg)
Documents in iCloudWhat is a document anyway?
A standalone entity, understood as such by the user
User might want to exchange (e.g., move it, modify it, send it via email)
![Page 18: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/18.jpg)
Documents in iCloudWhat is a document anyway?
A standalone entity, understood as such by the user
User might want to exchange (e.g., move it, modify it, send it via email)
![Page 19: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/19.jpg)
Dealing with Documents
![Page 20: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/20.jpg)
Document Access—Best PracticesReading and writing documents
![Page 21: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/21.jpg)
Document Access—Best PracticesReading and writing documents
Important—use file coordination!
![Page 22: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/22.jpg)
Document Access—Best PracticesReading and writing documents
Important—use file coordination!
Why? Avoid data loss!
![Page 23: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/23.jpg)
Document Access—Best PracticesReading and writing documents
Important—use file coordination!
Why? Avoid data loss!
There may be multiple readers/writers on the same document
![Page 24: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/24.jpg)
Document Access—Best PracticesReading and writing documents
Important—use file coordination!
Why? Avoid data loss!
There may be multiple readers/writers on the same document• Examples—iCloud, background saving, etc.
![Page 25: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/25.jpg)
Document Access—Best PracticesReading and writing documents
![Page 26: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/26.jpg)
Document Access—Best PracticesReading and writing documents
With file coordination
!Doc
![Page 27: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/27.jpg)
Document Access—Best PracticesReading and writing documents
With file coordination
!Doc
![Page 28: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/28.jpg)
Document Access—Best PracticesReading and writing documents
![Page 29: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/29.jpg)
Document Access—Best PracticesReading and writing documents
Without file coordination
!Doc
![Page 30: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/30.jpg)
Document Access—Best PracticesReading and writing documents
Without file coordination
Data Loss!
![Page 31: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/31.jpg)
Document Access—Best PracticesUIDocument makes things simple!
![Page 32: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/32.jpg)
Document Access—Best PracticesUIDocument makes things simple!
UIDocument/NSDocument do all heavy lifting for you
![Page 33: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/33.jpg)
Document Access—Best PracticesUIDocument makes things simple!
UIDocument/NSDocument do all heavy lifting for you• File coordination
![Page 34: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/34.jpg)
Document Access—Best PracticesUIDocument makes things simple!
UIDocument/NSDocument do all heavy lifting for you• File coordination
• Background queues
![Page 35: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/35.jpg)
Document Access—Best PracticesUIDocument makes things simple!
UIDocument/NSDocument do all heavy lifting for you• File coordination
• Background queues
• Multiple high-level APIs for every purpose
![Page 36: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/36.jpg)
Document Access—Best PracticesExample—reading a document from disk
Highest level—we read the file, you get an NSData or NSFileWrapper object - loadFromContents:ofType:error:
![Page 37: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/37.jpg)
Document Access—Best PracticesExample—reading a document from disk
Highest level—we read the file, you get an NSData or NSFileWrapper object - loadFromContents:ofType:error:
!
Intermediate level—we coordinate, you get an NSURL - readFromURL:error:
![Page 38: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/38.jpg)
Document Access—Best PracticesExample—reading a document from disk
Highest level—we read the file, you get an NSData or NSFileWrapper object - loadFromContents:ofType:error:
!
Intermediate level—we coordinate, you get an NSURL - readFromURL:error: !
Lowest level—provided for hooking - openWithCompletionHandler:
![Page 39: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/39.jpg)
Asynchronous File CoordinationNew File Coordination APIs
![Page 40: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/40.jpg)
Asynchronous File CoordinationNew File Coordination APIs
Existing File Coordination APIs were synchronous
![Page 41: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/41.jpg)
Asynchronous File CoordinationNew File Coordination APIs
Existing File Coordination APIs were synchronous
New File Coordinator API for asynchronous file coordination access
![Page 42: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/42.jpg)
Asynchronous File CoordinationNew File Coordination APIs
Existing File Coordination APIs were synchronous
New File Coordinator API for asynchronous file coordination access- coordinateAccessWithIntents:queue:byAccessor:
![Page 43: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/43.jpg)
Asynchronous File CoordinationNew File Coordination APIs
Existing File Coordination APIs were synchronous
New File Coordinator API for asynchronous file coordination access - coordinateAccessWithIntents:queue:byAccessor:
Use NSFileAccessIntent to specify purpose of coordination
![Page 44: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/44.jpg)
Asynchronous File CoordinationNew File Coordination APIs
Existing File Coordination APIs were synchronous
New File Coordinator API for asynchronous file coordination access - coordinateAccessWithIntents:queue:byAccessor:
Use NSFileAccessIntent to specify purpose of coordinationsrcInt = [NSFileAccessIntent readingIntentWithURL:srcURL options:srcOpts]; dstInt = [NSFileAccessIntent writingIntentWithURL:dstURL options:dstOpts]; [fileCoordinator coordinateAccessWithIntents:@[src, dst] queue:queue byAccessor:^(NSError *error) { // Do operation here with [srcInt URL] and [dstInt URL] }];
![Page 45: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/45.jpg)
Asynchronous File CoordinationNew File Coordination APIs
Existing File Coordination APIs were synchronous
New File Coordinator API for asynchronous file coordination access - coordinateAccessWithIntents:queue:byAccessor:
Use NSFileAccessIntent to specify purpose of coordinationsrcInt = [NSFileAccessIntent readingIntentWithURL:srcURL options:srcOpts]; dstInt = [NSFileAccessIntent writingIntentWithURL:dstURL options:dstOpts]; [fileCoordinator coordinateAccessWithIntents:@[src, dst] queue:queue byAccessor:^(NSError *error) { // Do operation here with [srcInt URL] and [dstInt URL] }];
![Page 46: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/46.jpg)
Asynchronous File CoordinationNew File Coordination APIs
Existing File Coordination APIs were synchronous
New File Coordinator API for asynchronous file coordination access - coordinateAccessWithIntents:queue:byAccessor:
Use NSFileAccessIntent to specify purpose of coordinationsrcInt = [NSFileAccessIntent readingIntentWithURL:srcURL options:srcOpts]; dstInt = [NSFileAccessIntent writingIntentWithURL:dstURL options:dstOpts]; [fileCoordinator coordinateAccessWithIntents:@[src, dst] queue:queue byAccessor:^(NSError *error) { // Do operation here with [srcInt URL] and [dstInt URL] }];
![Page 47: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/47.jpg)
Asynchronous File CoordinationNew File Coordination APIs
Existing File Coordination APIs were synchronous
New File Coordinator API for asynchronous file coordination access - coordinateAccessWithIntents:queue:byAccessor:
Use NSFileAccessIntent to specify purpose of coordinationsrcInt = [NSFileAccessIntent readingIntentWithURL:srcURL options:srcOpts]; dstInt = [NSFileAccessIntent writingIntentWithURL:dstURL options:dstOpts]; [fileCoordinator coordinateAccessWithIntents:@[src, dst] queue:queue byAccessor:^(NSError *error) { // Do operation here with [srcInt URL] and [dstInt URL] }];
![Page 48: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/48.jpg)
Discovering and Listing Documents
![Page 49: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/49.jpg)
Document DiscoveryDiscovering new and existing documents
![Page 50: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/50.jpg)
Document DiscoveryDiscovering new and existing documents
NSMetadataQuery APIs
![Page 51: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/51.jpg)
Document DiscoveryDiscovering new and existing documents
NSMetadataQuery APIs
Previously slow to pick up local changes (deletes, creates, renames)
![Page 52: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/52.jpg)
Your App
Your App’s Container
!Doc 1
!Doc 2
NSMetadataItem 1
NSMetadataItem 2
Document DiscoveryDiscovering new and existing documents
NSMetadataQuery APIs
Previously slow to pick up local changes (deletes, creates, renames)
![Page 53: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/53.jpg)
Your App
Your App’s Container
!Doc 1
!Doc 2
NSMetadataItem 1
NSMetadataItem 2
Document DiscoveryDiscovering new and existing documents
NSMetadataQuery APIs
Previously slow to pick up local changes (deletes, creates, renames)
!Doc 3Long delay…
![Page 54: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/54.jpg)
Your App
Your App’s Container
!Doc 1
!Doc 2
NSMetadataItem 1
NSMetadataItem 2
Document DiscoveryDiscovering new and existing documents
NSMetadataQuery APIs
Previously slow to pick up local changes (deletes, creates, renames)
!Doc 3
NSMetadataItem 3
![Page 55: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/55.jpg)
Document DiscoveryDiscovering new and existing documents
Your App
Your App’s Container
!Doc 1
!Doc 2
NSMetadataItem 1
NSMetadataItem 2
![Page 56: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/56.jpg)
Document DiscoveryDiscovering new and existing documents
NSMetadataQuery APIs easier to use directly with “stitching”
Your App
Your App’s Container
!Doc 1
!Doc 2
NSMetadataItem 1
NSMetadataItem 2
![Page 57: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/57.jpg)
Document DiscoveryDiscovering new and existing documents
NSMetadataQuery APIs easier to use directly with “stitching”
Your App
Your App’s Container
!Doc 1
!Doc 2
NSMetadataItem 1
NSMetadataItem 2
!Doc 3File coordination hook
updates query quickly
![Page 58: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/58.jpg)
Document DiscoveryDiscovering new and existing documents
NSMetadataQuery APIs easier to use directly with “stitching”
Your App
Your App’s Container
!Doc 1
!Doc 2
NSMetadataItem 1
NSMetadataItem 2
!Doc 3
NSMetadataItem 3
![Page 59: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/59.jpg)
Document DiscoveryDiscovering new and existing documents
NSMetadataQuery APIs easier to use directly with “stitching”
No file coordination required when listing documents
Your App
Your App’s Container
!Doc 1
!Doc 2
NSMetadataItem 1
NSMetadataItem 2
!Doc 3
NSMetadataItem 3
![Page 60: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/60.jpg)
Document DiscoveryAccessing metadata on documents
NSMetadataQuery can list non-local documents
New APIs to access metadata on those documents - getPromisedItemResourceValue:forKey:error:
![Page 61: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/61.jpg)
Document DiscoveryAccessing metadata on documents
NSMetadataQuery can list non-local documents
New APIs to access metadata on those documents - getPromisedItemResourceValue:forKey:error: - promisedItemResourceValuesForKeys:error:
![Page 62: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/62.jpg)
Document DiscoveryAccessing metadata on documents
NSMetadataQuery can list non-local documents
New APIs to access metadata on those documents - getPromisedItemResourceValue:forKey:error: - promisedItemResourceValuesForKeys:error:
!
New file coordinator flags for dealing with metadata NSFileCoordinatorReadingImmediatelyAvailableMetadataOnly NSFileCoordinatorWritingContentIndependentMetadataOnly
![Page 63: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/63.jpg)
Document Thumbnails
![Page 64: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/64.jpg)
Document Thumbnails
Best user experience when listing documents is to show previews
![Page 65: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/65.jpg)
Document Thumbnails
Best user experience when listing documents is to show previews
Possible previously but required custom implementation
![Page 66: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/66.jpg)
Document ThumbnailsDisplaying thumbnails in your UI
![Page 67: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/67.jpg)
Document ThumbnailsDisplaying thumbnails in your UI
New thumbnail keys available! • NSURLThumbnailDictionaryKey – NSDictionary
- NSThumbnail1024x1024SizeKey – UIImage / NSImage
• NSURLThumbnailKey (OSX) – NSImage
![Page 68: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/68.jpg)
Document ThumbnailsDisplaying thumbnails in your UI
New thumbnail keys available! • NSURLThumbnailDictionaryKey – NSDictionary
- NSThumbnail1024x1024SizeKey – UIImage / NSImage
• NSURLThumbnailKey (OSX) – NSImage
Easiest way to get thumbnails to display in UI - getPromisedItemResourceValue:forKey:error: - promisedItemResourceValuesForKeys:error:
![Page 69: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/69.jpg)
Document ThumbnailsSaving thumbnails
Easiest way to save thumbnails is through UIDocument - fileAttributesToWriteToURL:forSaveOperation:error:
![Page 70: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/70.jpg)
Document ThumbnailsSaving thumbnails
Easiest way to save thumbnails is through UIDocument - fileAttributesToWriteToURL:forSaveOperation:error:
Or you can set thumbnails manually - setResourceValue:forKey:error:
![Page 71: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/71.jpg)
Document ThumbnailsSaving thumbnails
Easiest way to save thumbnails is through UIDocument - fileAttributesToWriteToURL:forSaveOperation:error:
Or you can set thumbnails manually - setResourceValue:forKey:error:
OS X generates thumbnails automatically using your Quick Look plug-in
![Page 72: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/72.jpg)
Discover DocumentsOutside Your Container
![Page 73: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/73.jpg)
Document Discovery Not Always EasyDifficult to access documents from another app
Your App’s Container
!Doc 1
!Doc 2
Other App’s Container
!Doc 3
!Doc 4
!Doc 3
![Page 74: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/74.jpg)
Document Discovery Not Always EasyDifficult to access documents from another app
No easy way to discover documents outside your app from within your app
Your App’s Container
!Doc 1
!Doc 2
Other App’s Container
!Doc 3
!Doc 4
!Doc 3
![Page 75: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/75.jpg)
Document Discovery Not Always EasyDifficult to access documents from another app
No easy way to discover documents outside your app from within your app
Your App
Your App’s Container
!Doc 1
!Doc 2
Other App’s Container
!Doc 3
!Doc 4
!Doc 3
![Page 76: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/76.jpg)
Document Discovery Not Always EasyDifficult to access documents from another app
No easy way to discover documents outside your app from within your app
Your App Other App
Your App’s Container
!Doc 1
!Doc 2
Other App’s Container
!Doc 3
!Doc 4
!Doc 3
![Page 77: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/77.jpg)
Document Discovery Not Always EasyDifficult to access documents from another app
No easy way to discover documents outside your app from within your app
Your App Other App
Your App’s Container
!Doc 1
!Doc 2
Other App’s Container
!Doc 3
!Doc 4
!Doc 3
![Page 78: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/78.jpg)
Document Discovery Not Always EasyDifficult to access documents from another app
No easy way to discover documents outside your app from within your app
Your App Other App
Your App’s Container
!Doc 1
!Doc 2
Other App’s Container
!Doc 3
!Doc 4
!Doc 3
!Doc 3
![Page 79: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/79.jpg)
Document Discovery Not Always EasyDifficult to access documents from another app
No easy way to discover documents outside your app from within your app
Your App Other App
Your App’s Container
!Doc 1
!Doc 2
Other App’s Container
!Doc 3
!Doc 4
!Doc 3
!Doc 3
![Page 80: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/80.jpg)
Document Discovery Made EasierAccessing documents directly
Your App’s Container
!Doc 1
!Doc 2
Other App’s Container
!Doc 3
!Doc 4
!Doc 3
![Page 81: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/81.jpg)
Document Discovery Made EasierAccessing documents directly
Better user experience to open documents directly
Your App’s Container
!Doc 1
!Doc 2
Other App’s Container
!Doc 3
!Doc 4
!Doc 3
![Page 82: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/82.jpg)
Document Discovery Made EasierAccessing documents directly
Better user experience to open documents directly
Your App
Your App’s Container
!Doc 1
!Doc 2
Other App’s Container
!Doc 3
!Doc 4
!Doc 3
![Page 83: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/83.jpg)
Document Discovery Made EasierAccessing documents directly
Better user experience to open documents directly
Your App
Your App’s Container
!Doc 1
!Doc 2
Other App’s Container
!Doc 3
!Doc 4
!Doc 3
![Page 84: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/84.jpg)
Document Discovery Made EasierAccess documents outside your container
![Page 85: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/85.jpg)
Document Discovery Made EasierAccess documents outside your container
UIDocumentPickerViewController allows your users to • Discover documents outside of your app’s sandbox
• Grant your app permissions to access and edit the discovered documents
![Page 86: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/86.jpg)
Document Discovery Made EasierAccess documents outside your container
UIDocumentPickerViewController allows your users to • Discover documents outside of your app’s sandbox
• Grant your app permissions to access and edit the discovered documents
Must opt-in to have documents displayed
NSUbiquitousContainerIsDocumentScopePublic = YES
![Page 87: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/87.jpg)
Document Discovery Made EasierAccess documents outside your container
UIDocumentPickerViewController allows your users to • Discover documents outside of your app’s sandbox
• Grant your app permissions to access and edit the discovered documents
Must opt-in to have documents displayed
NSUbiquitousContainerIsDocumentScopePublic = YES
Great new UI which you display in your app
![Page 88: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/88.jpg)
DemoUsing the document picker in a simple application
![Page 89: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/89.jpg)
Summary
![Page 90: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/90.jpg)
Summary
Easy to display UIDocumentPickerViewController
![Page 91: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/91.jpg)
Summary
Easy to display UIDocumentPickerViewController
Users can now select documents from other apps’ containers
![Page 92: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/92.jpg)
Summary
Easy to display UIDocumentPickerViewController
Users can now select documents from other apps’ containers
Easy to make your container show up in UIDocumentPickerViewController
![Page 93: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/93.jpg)
Managing External DocumentsDocument references, scoped access, and bookmarks
Johannes Fortmann Software Engineer
![Page 94: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/94.jpg)
Managing Document ReferencesDocument references in your container
Your App’s Container
!Doc 1
!Doc 2
Other App’s Container
!Doc 3
!Doc 4
!Doc 3
![Page 95: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/95.jpg)
Managing Document ReferencesDocument references in your container
Your app always has access to its own container
Your App’s Container
!Doc 1
!Doc 2
Other App’s Container
!Doc 3
!Doc 4
!Doc 3
![Page 96: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/96.jpg)
Managing Document ReferencesDocument references in your container
Your app always has access to its own container
Your App
Your App’s Container
!Doc 1
!Doc 2
Other App’s Container
!Doc 3
!Doc 4
!Doc 3
![Page 97: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/97.jpg)
Managing Document ReferencesDocument references in your container
Your app always has access to its own container
For other documents, we save a document reference
Your App
Your App’s Container
!Doc 1
!Doc 2
Other App’s Container
!Doc 3
!Doc 4
!Doc 3
![Page 98: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/98.jpg)
Managing Document ReferencesDocument references in your container
Your app always has access to its own container
For other documents, we save a document reference
Your App
Your App’s Container
!Doc 1
!Doc 2
Other App’s Container
!Doc 3
!Doc 4
!Doc 3
!Doc 3
![Page 99: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/99.jpg)
Managing Document ReferencesNew attributes
NSMetadataQueryUbiquitousDocumentsScope
NSMetadataItem 1
NSMetadataItem 2Your App’s Container
!Doc 1
Other App’s Container
!Doc 2
!Doc 3
!Doc 4
![Page 100: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/100.jpg)
Managing Document ReferencesNew attributes
NSMetadataQueryUbiquitousDocumentsScope
NSMetadataItem 1
NSMetadataItem 2Your App’s Container
!Doc 1
Other App’s Container
!Doc 2
!Doc 3
!Doc 3
!Doc 4
![Page 101: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/101.jpg)
NSMetadataUbiquitousItemURLInLocalContainerKey
Managing Document ReferencesNew attributes
NSMetadataQueryUbiquitousDocumentsScope NSMetadataQueryAccessibleUbiquitousExternalDocumentsScope
Your App’s Container
!Doc 1
Other App’s Container
!Doc 2
!Doc 3
!Doc 3
!Doc 4
NSMetadataItem 1
NSMetadataItem 2
NSMetadataItem 3
![Page 102: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/102.jpg)
NSMetadataUbiquitousItemURLInLocalContainerKey
Managing Document ReferencesNew attributes
NSMetadataQueryUbiquitousDocumentsScope NSMetadataQueryAccessibleUbiquitousExternalDocumentsScope
Your App’s Container
!Doc 1
Other App’s Container
!Doc 2
!Doc 3
!Doc 3
!Doc 4
NSMetadataItemURLKey
NSMetadataItem 1
NSMetadataItem 2
NSMetadataItem 3
![Page 103: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/103.jpg)
Managing Document ReferencesNew attributes
NSMetadataQueryUbiquitousDocumentsScope NSMetadataQueryAccessibleUbiquitousExternalDocumentsScope
Your App’s Container
!Doc 1
Other App’s Container
!Doc 2
!Doc 3
!Doc 3
!Doc 4
NSMetadataUbiquitousItemURLInLocalContainerKey
NSMetadataItem 1
NSMetadataItem 2
NSMetadataItem 3
NSMetadataItemURLKey
![Page 104: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/104.jpg)
Managing Document ReferencesNew attributes
NSMetadataQueryUbiquitousDocumentsScope NSMetadataQueryAccessibleUbiquitousExternalDocumentsScope
Your App’s Container
!Doc 1
Other App’s Container
!Doc 2
!Doc 3
!Doc 3
!Doc 4
NSMetadataUbiquitousItemIsExternalDocumentKey
NSMetadataItem 1
NSMetadataItem 2
NSMetadataItem 3
![Page 105: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/105.jpg)
Managing Document ReferencesNew attributes
NSMetadataQueryUbiquitousDocumentsScope NSMetadataQueryAccessibleUbiquitousExternalDocumentsScope
Your App’s Container
!Doc 1
Other App’s Container
!Doc 2
!Doc 3
!Doc 3
!Doc 4
NSMetadataUbiquitousItemIsExternalDocumentKey
NO
NO
YES
NSMetadataItem 1
NSMetadataItem 2
NSMetadataItem 3
![Page 106: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/106.jpg)
Managing Document ReferencesNew attributes
NSMetadataQueryUbiquitousDocumentsScope NSMetadataQueryAccessibleUbiquitousExternalDocumentsScope
Your App’s Container
!Doc 1
Other App’s Container
!Doc 2
!Doc 3
!Doc 3
!Doc 4
NSMetadataUbiquitousItemContainerDisplayNameKey
MyApp
MyApp
OtherApp
NSMetadataItem 1
NSMetadataItem 2
NSMetadataItem 3
![Page 107: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/107.jpg)
Managing Document ReferencesWhy do you need the document reference?
![Page 108: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/108.jpg)
Managing Document ReferencesWhy do you need the document reference?
The document picker is running out-of-process for security
![Page 109: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/109.jpg)
Managing Document ReferencesWhy do you need the document reference?
The document picker is running out-of-process for security
The only way to get a document outside your container is by using the picker
URL returned by the picker is security scoped
URL
Scope
Serialized NSURL
URL
![Page 110: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/110.jpg)
Managing Document ReferencesWhy do you need the document reference?
The document picker is running out-of-process for security
The only way to get a document outside your container is by using the picker
URL returned by the picker is security scoped
When saving a URL (state restoration, recents list), scope would be lost
URL
Scope
Serialized NSURL
URL
![Page 111: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/111.jpg)
Managing Document ReferencesWhy do you need the document reference?
The document picker is running out-of-process for security
The only way to get a document outside your container is by using the picker
URL returned by the picker is security scoped
When saving a URL (state restoration, recents list), scope would be lost
You need a way to get back to the scoped URL
URL
Scope
Serialized NSURL
URL
![Page 112: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/112.jpg)
Managing Document ReferencesWhy do you need the document reference?
The document picker is running out-of-process for security
The only way to get a document outside your container is by using the picker
URL returned by the picker is security scoped
When saving a URL (state restoration, recents list), scope would be lost
You need a way to get back to the scoped URL
Document references come with scope pre-attached
URL
Scope
Serialized NSURL
URL
![Page 113: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/113.jpg)
Managing Document ReferencesBookmarks for state restoration
![Page 114: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/114.jpg)
Managing Document ReferencesBookmarks for state restoration
Sometimes enumerating documents is not the right choice
![Page 115: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/115.jpg)
Managing Document ReferencesBookmarks for state restoration
Sometimes enumerating documents is not the right choice• E.g., you want to restore a previously opened document immediately
![Page 116: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/116.jpg)
Managing Document ReferencesBookmarks for state restoration
Sometimes enumerating documents is not the right choice• E.g., you want to restore a previously opened document immediately
Creating a bookmark encodes a portable reference to a document
![Page 117: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/117.jpg)
Managing Document ReferencesBookmarks for state restoration
Sometimes enumerating documents is not the right choice• E.g., you want to restore a previously opened document immediately
Creating a bookmark encodes a portable reference to a document
Includes the security scope
![Page 118: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/118.jpg)
Managing Document ReferencesBookmarks for state restoration
Bookmark creation via API -bookmarkDataWithOptions:
![Page 119: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/119.jpg)
Managing Document ReferencesBookmarks for state restoration
Bookmark creation via API -bookmarkDataWithOptions:
URL
Scope
NSData +
Scope
![Page 120: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/120.jpg)
Managing Document ReferencesBookmarks for state restoration
Bookmark creation via API -bookmarkDataWithOptions: !
+URLByResolvingBookmarkData:savedBookmarkData
URL
Scope
NSData +
Scope
![Page 121: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/121.jpg)
Managing Document ReferencesBookmarks for state restoration
Bookmark creation via API -bookmarkDataWithOptions: !
+URLByResolvingBookmarkData:savedBookmarkData
URL
Scope
NSData +
Scope
URL
Scope
![Page 122: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/122.jpg)
Document References and the PickerUIDocumentPickerMode—Import vs. Open
![Page 123: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/123.jpg)
Other App’s Container
Document References and the PickerUIDocumentPickerMode—Import vs. Open
Open mode will create a bookmark and a security-scoped URL
Your App’s Container
!Doc 1
!Doc 2
!Doc 3
!Doc 3
![Page 124: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/124.jpg)
Other App’s Container
Document References and the PickerUIDocumentPickerMode—Import vs. Open
Open mode will create a bookmark and a security-scoped URL
Import mode will not create a bookmark
Your App’s Container
!Doc 1
!Doc 2
!Doc 3
![Page 125: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/125.jpg)
Other App’s ContainerTemporary Location
Document References and the PickerUIDocumentPickerMode—Import vs. Open
Open mode will create a bookmark and a security-scoped URL
Import mode will not create a bookmark
You can read the file, but it is temporary
Your App’s Container
!Doc 1
!Doc 2
!Doc 3
!Doc 3
![Page 126: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/126.jpg)
Other App’s ContainerTemporary Location
Document References and the PickerUIDocumentPickerMode—Import vs. Open
Open mode will create a bookmark and a security-scoped URL
Import mode will not create a bookmark
You can read the file, but it is temporary
Make a copy soon if you want to hang on to it
Your App’s Container
!Doc 1
!Doc 2
!Doc 3
![Page 127: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/127.jpg)
How to Create a New DocumentNo write access except in your sandbox
![Page 128: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/128.jpg)
How to Create a New DocumentNo write access except in your sandbox
You will not have general access to other app’s containers
![Page 129: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/129.jpg)
How to Create a New DocumentNo write access except in your sandbox
You will not have general access to other app’s containers
Write in your own container locally or in a temporary location
![Page 130: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/130.jpg)
How to Create a New DocumentNo write access except in your sandbox
You will not have general access to other app’s containers
Write in your own container locally or in a temporary location
Afterwards, you can move the document
![Page 131: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/131.jpg)
Existing DocumentsMoving a document
Your App’s Container
!Doc 1
!Doc 2
Other App’s Container
!Doc 3
![Page 132: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/132.jpg)
Existing DocumentsMoving a document
Use UIDocumentPicker -initWithURL: and your existing document
Your App’s Container
!Doc 1
!Doc 2
Other App’s Container
!Doc 3
![Page 133: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/133.jpg)
Existing DocumentsMoving a document
Use UIDocumentPicker -initWithURL: and your existing document
The file will be moved to the location the user picks
Your App’s Container
!Doc 1
!Doc 2
Other App’s Container
!Doc 3
![Page 134: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/134.jpg)
Existing DocumentsMoving a document
Use UIDocumentPicker -initWithURL: and your existing document
The file will be moved to the location the user picks
You will get a URL and a reference for the new location
Your App’s Container
!Doc 1
!Doc 2
Other App’s Container
!Doc 3
!Doc 3
![Page 135: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/135.jpg)
Existing DocumentsMoving a document
Use UIDocumentPicker -initWithURL: and your existing document
The file will be moved to the location the user picks
You will get a URL and a reference for the new location
The URL behaves like the one returned by Open
Your App’s Container
!Doc 1
!Doc 2
Other App’s Container
!Doc 3
!Doc 3
![Page 136: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/136.jpg)
Existing DocumentsMoving a document
Use UIDocumentPicker -initWithURL: and your existing document
The file will be moved to the location the user picks
You will get a URL and a reference for the new location
The URL behaves like the one returned by Open
Your App’s Container
!Doc 1
!Doc 2
Other App’s Container
!Doc 3
![Page 137: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/137.jpg)
Existing DocumentsMoving a document
Use UIDocumentPicker -initWithURL: and your existing document
The file will be moved to the location the user picks
You will get a URL and a reference for the new location
The URL behaves like the one returned by Open
Export mode if you don’t want to hang on to the reference
Your App’s Container
!Doc 1
!Doc 2
Other App’s Container
!Doc 3
![Page 138: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/138.jpg)
Existing DocumentsMoving a document
Use UIDocumentPicker -initWithURL: and your existing document
The file will be moved to the location the user picks
You will get a URL and a reference for the new location
The URL behaves like the one returned by Open
Export mode if you don’t want to hang on to the reference
Your App’s Container
!Doc 1
!Doc 2
Other App’s Container
!Doc 3
!Doc 3
![Page 139: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/139.jpg)
Document ManagementSummary
![Page 140: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/140.jpg)
Document ManagementSummary
Document references for enumerating picked documents
![Page 141: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/141.jpg)
Document ManagementSummary
Document references for enumerating picked documents
Bookmarks for state restoration
![Page 142: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/142.jpg)
Document ManagementSummary
Document references for enumerating picked documents
Bookmarks for state restoration
Modes for Import, Open, Export, Move
![Page 143: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/143.jpg)
Document ManagementSummary
Document references for enumerating picked documents
Bookmarks for state restoration
Modes for Import, Open, Export, Move
Allows the user to access all their iCloud documents
![Page 144: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/144.jpg)
Document Provider ExtensionsProviding document storage to other apps
![Page 145: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/145.jpg)
What Is a Document Provider?Alternative storage locations
![Page 146: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/146.jpg)
What Is a Document Provider?Alternative storage locations
Alternative way for a third-party to provide document storage
![Page 147: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/147.jpg)
What Is a Document Provider?Alternative storage locations
Alternative way for a third-party to provide document storage
Same perspective from the host app’s point of view
![Page 148: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/148.jpg)
What Is a Document Provider?Alternative storage locations
Alternative way for a third-party to provide document storage
Same perspective from the host app’s point of view
Selectable from the document picker
![Page 149: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/149.jpg)
What Is a Document Provider?Alternative storage locations
Alternative way for a third-party to provide document storage
Same perspective from the host app’s point of view
Selectable from the document picker
Can offer the same picker modes as the standard picker
![Page 150: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/150.jpg)
What Is a Document Provider?Alternative storage locations
Alternative way for a third-party to provide document storage
Same perspective from the host app’s point of view
Selectable from the document picker
Can offer the same picker modes as the standard picker
Implemented using two extensions
![Page 151: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/151.jpg)
What Is a Document Provider?Alternative storage locations
Alternative way for a third-party to provide document storage
Same perspective from the host app’s point of view
Selectable from the document picker
Can offer the same picker modes as the standard picker
Implemented using two extensions
Document Picker Extension
![Page 152: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/152.jpg)
What Is a Document Provider?Alternative storage locations
Alternative way for a third-party to provide document storage
Same perspective from the host app’s point of view
Selectable from the document picker
Can offer the same picker modes as the standard picker
Implemented using two extensions
UIDocumentPickerVC
Document Picker Extension
![Page 153: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/153.jpg)
What Is a Document Provider?Alternative storage locations
Alternative way for a third-party to provide document storage
Same perspective from the host app’s point of view
Selectable from the document picker
Can offer the same picker modes as the standard picker
Implemented using two extensions
UIDocumentPickerVC
Document Picker Extension
File Provider Extension
![Page 154: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/154.jpg)
What Is a Document Provider?Alternative storage locations
Alternative way for a third-party to provide document storage
Same perspective from the host app’s point of view
Selectable from the document picker
Can offer the same picker modes as the standard picker
Implemented using two extensions
UIDocumentPickerVC
Document Picker Extension
NSFileCoordinator
File Provider Extension
![Page 155: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/155.jpg)
Document Provider ExtensionsData flow for selection and read access
User App
Your Extension
UIKit/Foundation
Host
API
![Page 156: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/156.jpg)
Document Provider ExtensionsData flow for selection and read access
initWithDocumentTypes:inMode:
UIDocumentPickerVC
User App
Your Extension
UIKit/Foundation
Host
API
![Page 157: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/157.jpg)
Document Provider ExtensionsData flow for selection and read access
prepareForPresentationInMode:
Document Picker
UIDocumentPickerVC
User App
Your Extension
UIKit/Foundation
Host
API
![Page 158: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/158.jpg)
Document Provider ExtensionsData flow for selection and read access
dismissGrantingAccessToURL:
Document Picker
UIDocumentPickerVC
User App
Your Extension
UIKit/Foundation
Host
API
![Page 159: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/159.jpg)
Document Provider ExtensionsData flow for selection and read access
documentPicker:didPickDocumentAtURL:
Document Picker
UIDocumentPickerVC
User App
Your Extension
UIKit/Foundation
Host
API
![Page 160: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/160.jpg)
Document Provider ExtensionsData flow for selection and read access
coordinateReadingItemAtURL:
Document Picker
NSFileCoordinatorUIDocumentPickerVC
User App
Your Extension
UIKit/Foundation
Host
API
![Page 161: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/161.jpg)
Document Provider ExtensionsData flow for selection and read access
startProvidingItemAtURL:
File ProviderDocument Picker
NSFileCoordinatorUIDocumentPickerVC
User App
Your Extension
UIKit/Foundation
Host
API
![Page 162: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/162.jpg)
Document Provider ExtensionsData flow for selection and read access
completion()
File ProviderDocument Picker
NSFileCoordinatorUIDocumentPickerVC
User App
Your Extension
UIKit/Foundation
Host
API
![Page 163: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/163.jpg)
Document Provider ExtensionsData flow for selection and read access
accessorBlock()
File ProviderDocument Picker
NSFileCoordinatorUIDocumentPickerVC
User App
Your Extension
UIKit/Foundation
Host
API
![Page 164: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/164.jpg)
Document Provider ExtensionsData flow for selection and read access
dataWithContentsOfURL:
File ProviderDocument Picker
NSFileCoordinatorUIDocumentPickerVC
User App
Your Extension
UIKit/Foundation
Host
API
![Page 165: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/165.jpg)
Document Provider ExtensionsSecurity and bookmarks
![Page 166: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/166.jpg)
Document Provider ExtensionsSecurity and bookmarks
Document provider extensions don’t take part in document reference mechanism
![Page 167: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/167.jpg)
Document Provider ExtensionsSecurity and bookmarks
Document provider extensions don’t take part in document reference mechanism
But bookmarks still work
![Page 168: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/168.jpg)
Document Provider ExtensionsSecurity and bookmarks
Document provider extensions don’t take part in document reference mechanism
But bookmarks still work
File provider returns/resolves an identifier
![Page 169: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/169.jpg)
Document Provider ExtensionsSecurity and bookmarks
Document provider extensions don’t take part in document reference mechanism
But bookmarks still work
File provider returns/resolves an identifier
Access is controlled by isolation layer
![Page 170: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/170.jpg)
Document Provider ExtensionsBookmark data flow
Non-UI Extension
UIKit/Foundation
Host
API
User App User App
![Page 171: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/171.jpg)
Document Provider ExtensionsBookmark data flow
Non-UI Extension
UIKit/Foundation
Host
API bookmarkDataWithOptions:
NSURL
User App User App
![Page 172: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/172.jpg)
Document Provider ExtensionsBookmark data flow
Non-UI Extension
UIKit/Foundation
Host
API persistentIdentifierForItemAtURL:
File Provider
NSURL
User App User App
![Page 173: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/173.jpg)
Document Provider ExtensionsBookmark data flow
Non-UI Extension
UIKit/Foundation
Host
API NSString *identifier
File Provider
NSURL
User App User App
![Page 174: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/174.jpg)
Document Provider ExtensionsBookmark data flow
Non-UI Extension
UIKit/Foundation
Host
API NSData *bookmarkData
File Provider
NSURL
User App User App
![Page 175: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/175.jpg)
Document Provider ExtensionsBookmark data flow
Non-UI Extension
UIKit/Foundation
Host
API URLByResolvingBookmarkData:
File Provider
NSURLNSURL
User App User App
![Page 176: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/176.jpg)
Document Provider ExtensionsBookmark data flow
Non-UI Extension
UIKit/Foundation
Host
API URLForItemWithPersistentIdentifier: providePlaceholderAtURL:
File ProviderFile Provider
NSURLNSURL
User App User App
![Page 177: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/177.jpg)
Document Provider ExtensionsBookmark data flow
Non-UI Extension
UIKit/Foundation
Host
API
File ProviderFile Provider
NSURLNSURL
User App User App
URLForItemWithPersistentIdentifier: providePlaceholderAtURL:
![Page 178: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/178.jpg)
Document Provider ExtensionsBookmark data flow
Non-UI Extension
UIKit/Foundation
Host
API NSURL *url
File ProviderFile Provider
NSURLNSURL
User App User App
![Page 179: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/179.jpg)
Document Provider ExtensionsBookmark data flow
Non-UI Extension
UIKit/Foundation
Host
API getPromisedItemResourceValue: NSFileCoordinator API
File ProviderFile Provider
NSURLNSURL
User App User App
![Page 180: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/180.jpg)
Document Provider ExtensionsBookmark data flow
Non-UI Extension
UIKit/Foundation
Host
API
File ProviderFile Provider
NSURLNSURL
User App User App
getPromisedItemResourceValue: NSFileCoordinator API
![Page 181: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/181.jpg)
Document Provider ExtensionsWriting files
Storage App’s Folder
!Doc 1User App
![Page 182: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/182.jpg)
Document Provider ExtensionsWriting files
Host app uses file coordination to write file
Storage App’s Folder
!Doc 1User App
![Page 183: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/183.jpg)
Document Provider ExtensionsWriting files
Host app uses file coordination to write file
Storage App’s Folder
!Doc 1User App
!Doc 1*
![Page 184: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/184.jpg)
Document Provider ExtensionsWriting files
Host app uses file coordination to write file
Soon after, itemChangedAtURL: is called on the file provider
Storage App’s Folder
!Doc 1User App File Provider
!Doc 1*
![Page 185: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/185.jpg)
Document Provider ExtensionsWriting files
Host app uses file coordination to write file
Soon after, itemChangedAtURL: is called on the file provider
File provider can e.g., initiate an upload
Storage App’s Folder
!Doc 1User App File Provider
!Doc 1*
![Page 186: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/186.jpg)
DemoBuilding a simple Document Provider
![Page 187: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/187.jpg)
Summary
![Page 188: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/188.jpg)
Summary
Xcode template to get you started with a Document Provider
![Page 189: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/189.jpg)
Summary
Xcode template to get you started with a Document Provider
Document Provider shows up next to iCloud picker
![Page 190: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/190.jpg)
Summary
Xcode template to get you started with a Document Provider
Document Provider shows up next to iCloud picker
Sample code is available to display each of the picker modes
![Page 191: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/191.jpg)
From Documents in theCloud to iCloud DriveFor users
![Page 192: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/192.jpg)
From Documents in theCloud to iCloud DriveFor users
On iOS 8, users can choose to continue using iCloud Documents or migrate to iCloud Drive
![Page 193: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/193.jpg)
From Documents in theCloud to iCloud DriveFor users
On iOS 8, users can choose to continue using iCloud Documents or migrate to iCloud Drive
On OS X Yosemite, users can choose to migrate to iCloud Drive or changes will no longer update across devices
![Page 194: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/194.jpg)
From Documents in theCloud to iCloud DriveFor users
On iOS 8, users can choose to continue using iCloud Documents or migrate to iCloud Drive
On OS X Yosemite, users can choose to migrate to iCloud Drive or changes will no longer update across devices
After an account is migrated to iCloud Drive, only devices using iCloud Drive will propagate changes to each other
![Page 195: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/195.jpg)
From Documents in theCloud to iCloud DriveFor developers
![Page 196: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/196.jpg)
From Documents in theCloud to iCloud DriveFor developers
The OS X Yosemite Developer Preview and the iOS 8 Beta use iCloud Drive
![Page 197: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/197.jpg)
From Documents in theCloud to iCloud DriveFor developers
The OS X Yosemite Developer Preview and the iOS 8 Beta use iCloud Drive
New features are only available in iCloud Drive
![Page 198: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/198.jpg)
Summary
![Page 199: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/199.jpg)
Summary
File coordination for document access
![Page 200: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/200.jpg)
Summary
File coordination for document access
Discovery and display of files
![Page 201: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/201.jpg)
Summary
File coordination for document access
Discovery and display of files
Using UIDocumentPicker to access files outside your container
![Page 202: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/202.jpg)
Summary
File coordination for document access
Discovery and display of files
Using UIDocumentPicker to access files outside your container
Document Provider extensions to support third-party providers
![Page 203: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/203.jpg)
More Information
Dave DeLong App Frameworks Evangelist [email protected]
Jake Behrens App Frameworks Evangelist [email protected]
![Page 204: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/204.jpg)
More Information
Documentation iCloud for Developers http://developer.apple.com/icloud
Document Picker Programming Guide http://developer.apple.com
Apple Developer Forums http://devforums.apple.com
![Page 205: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/205.jpg)
Related Sessions
• Introducing CloudKit Mission Tuesday 3:15PM
• Creating Extensions for iOS and OS X, Part 1 Mission Tuesday 2:00PM
• Creating Extensions for iOS and OS X, Part 2 Mission Wednesday 11:30AM
![Page 206: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/206.jpg)
Labs
• Extensions Lab Frameworks Lab B Thursday 2:00PM
![Page 207: Cloud Documents in Your Application€¦ · Building a modern document-based application Session 234 Mike Hess Software Engineer Frameworks! Johannes Fortmann Software Engineer. Changes](https://reader035.fdocuments.net/reader035/viewer/2022081402/5f16b30179be16316c7a7dcf/html5/thumbnails/207.jpg)