Integrating with Photos on macOS
Integrating with Photos on macOS
WWDC 2018
Project Categories ( new )
PHProjectInfo
PHProjectInfo Updates ( new )
Updating appends sections for new assets
Regions of Interest ( new )
Supporting Copy and Paste ( new )
- Implement
validateMenuItem(_ menuItem: NSMenuItem)
- Only return
true
if the extension can handle the current pasteboard content
Supporting Drag and Drop
- Photos handles drags of assets to the extension by default
- The extension should only handle extension-internal drags
Interacting with Photos
Drag and Drop on macOS
- Uses NSPasteboard
- Data is written and read using the main thread
Then and Now
- Only local content
- Read and Write file URLs to the pasteboard
- Data in iCloud with Optimized Local Storage
- Privacy Settings
File Promises
What is a file promise ?
- Promise that a file of a certain type will be written to a provided location
- Allows the sender to write a promised file in the background
- NSFilePromiseReceiver
- NSFilePromiseProvider
- What’s New in Cocoa ( WWDC 2016 )