Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW...

212
#WWDC17 © 2017 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple. Tom Adriaenssen, UIKit Wenson Hsieh, WebKit Robb Böhnke, UIKit Mastering Drag and Drop Session 213 App Frameworks

Transcript of Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW...

Page 1: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

#WWDC17

© 2017 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple.

Tom Adriaenssen, UIKit Wenson Hsieh, WebKit Robb Böhnke, UIKit

Mastering Drag and Drop • Session 213

App Frameworks

Page 2: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

NEW

Page 3: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drag and Drop API Roadmap

DragSession

DragInteraction

Drag Interaction Delegate

ItemProvider

Drag Item

Preview

DropSession

Drop Interaction

Drop Interaction Delegate

Page 4: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drag and Drop API Roadmap

DragSession

DragInteraction

Drag Interaction Delegate

ItemProvider

Drag Item

Preview

DropSession

Drop Interaction

Drop Interaction Delegate

Drag and Drop with Collection and Table View Hall 2 Thursday 9:00AM

Page 5: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drag and Drop API Roadmap

DragSession

DragInteraction

Drag Interaction Delegate

ItemProvider

Drag Item

Preview

DropSession

Drop Interaction

Drop Interaction Delegate

Data Delivery with Drag and Drop Hall 2 Thursday 10:00AM

Page 6: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drag and Drop API Roadmap

DragSession

DragInteraction

Drag Interaction Delegate

ItemProvider

Drag Item

Preview

DropSession

Drop Interaction

Drop Interaction Delegate

Page 7: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drag and Drop API Roadmap

DragSession

DragInteraction

Drag Interaction Delegate

ItemProvider

Drag Item

Preview

DropSession

Drop Interaction

Drop Interaction Delegate

Page 8: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Robb Böhnke, UIKit

•Advanced Drag Interactions

Page 9: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

UIDragInteraction

Can be added to any view

Installs gestures

Delegate does the work

Page 10: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Returns UIDragItems associated with the drag

May provide a preview during the lift or for cancelling

May can animate alongside the lift

May get notified of drag session lifecycle

UIDragInteractionDelegate

Page 11: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Returns UIDragItems associated with the drag

May provide a preview during the lift or for cancelling

May can animate alongside the lift

May get notified of drag session lifecycle

UIDragInteractionDelegate

Introducing Drag and Drop Hall 3 Tuesday 11:20AM

Page 12: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...
Page 13: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...
Page 14: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegate

Page 15: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegatefunc dragInteraction(_ interaction: UIDragInteraction, itemsForBeginning session: UIDragSession) -> [UIDragItem] {

Page 16: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegatefunc dragInteraction(_ interaction: UIDragInteraction, itemsForBeginning session: UIDragSession) -> [UIDragItem] { let itemProvider = NSItemProvider(message)

Page 17: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegatefunc dragInteraction(_ interaction: UIDragInteraction, itemsForBeginning session: UIDragSession) -> [UIDragItem] { let itemProvider = NSItemProvider(message)

let dragItem = UIDragItem(itemProvider: itemProvider)

Page 18: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegatefunc dragInteraction(_ interaction: UIDragInteraction, itemsForBeginning session: UIDragSession) -> [UIDragItem] { let itemProvider = NSItemProvider(message)

let dragItem = UIDragItem(itemProvider: itemProvider) dragItem.localObject = message

Page 19: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegatefunc dragInteraction(_ interaction: UIDragInteraction, itemsForBeginning session: UIDragSession) -> [UIDragItem] { let itemProvider = NSItemProvider(message)

let dragItem = UIDragItem(itemProvider: itemProvider) dragItem.localObject = message

return [ dragItem ]}DontDeleteThis

Page 20: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

let itemProvider = NSItemProvider(message)

let dragItem = UIDragItem(itemProvider: itemProvider) dragItem.localObject = message

return [ dragItem ] }DontDeleteThis

// UIDragInteractionDelegate func dragInteraction(_ interaction: UIDragInteraction, itemsForAddingTo session: UIDragSession, withTouchAt point: CGPoint) -> [UIDragItem] {

Page 21: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegate func dragInteraction(_ interaction: UIDragInteraction, itemsForAddingTo session: UIDragSession, withTouchAt point: CGPoint) -> [UIDragItem] {

let itemProvider = NSItemProvider(message)

let dragItem = UIDragItem(itemProvider: itemProvider)

dragItem.localObject = message

return [ dragItem ] }DontDeleteThis

Page 22: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegate func dragInteraction(_ interaction: UIDragInteraction, itemsForAddingTo session: UIDragSession, withTouchAt point: CGPoint) -> [UIDragItem] {

for item in session.items { guard item.itemProvider.hasItemConformingToTypeIdentifier("private.example.mail") else { return [] } }

let itemProvider = NSItemProvider(message)

let dragItem = UIDragItem(itemProvider: itemProvider)

dragItem.localObject = message

return [ dragItem ] }DontDeleteThis

Page 23: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegate func dragInteraction(_ interaction: UIDragInteraction, itemsForAddingTo session: UIDragSession, withTouchAt point: CGPoint) -> [UIDragItem] {

for item in session.items { guard item.itemProvider.hasItemConformingToTypeIdentifier("private.example.mail") else { return [] } }

let itemProvider = NSItemProvider(message)

let dragItem = UIDragItem(itemProvider: itemProvider)

dragItem.localObject = message

return [ dragItem ] }DontDeleteThis

guard item.localObject != message { return [] }

Page 24: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...
Page 25: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...
Page 26: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegate

Page 27: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegatefunc dragInteraction(_ interaction: UIDragInteraction, itemsForBeginning session: UIDragSession) -> [UIDragItem] {

Page 28: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegatefunc dragInteraction(_ interaction: UIDragInteraction, itemsForBeginning session: UIDragSession) -> [UIDragItem] { return mailThread

.messages

Page 29: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegatefunc dragInteraction(_ interaction: UIDragInteraction, itemsForBeginning session: UIDragSession) -> [UIDragItem] { return mailThread

.messages .sorted { a, b in

return a.sentDate.timeIntervalSince1970 > b.sentDate.timeIntervalSince1970

}

Page 30: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegatefunc dragInteraction(_ interaction: UIDragInteraction, itemsForBeginning session: UIDragSession) -> [UIDragItem] { return mailThread

.messages .sorted { a, b in

return a.sentDate.timeIntervalSince1970 > b.sentDate.timeIntervalSince1970

} .map { message -> UIDragItem in

let itemProvider = NSItemProvider(message)

let dragItem = UIDragItem(itemProvider: itemProvider)

dragItem.localObject = message

return dragItem

}}

Page 31: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegate

Page 32: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegatefunc dragInteraction(_ interaction: UIDragInteraction, previewForLifting item: UIDragItem, session: UIDragSession) -> UITargetedDragPreview?

Page 33: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegatefunc dragInteraction(_ interaction: UIDragInteraction, previewForLifting item: UIDragItem, session: UIDragSession) -> UITargetedDragPreview? guard let message = item.localObject as? Message else {

return nil

}

Page 34: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegatefunc dragInteraction(_ interaction: UIDragInteraction, previewForLifting item: UIDragItem, session: UIDragSession) -> UITargetedDragPreview? guard let message = item.localObject as? Message else {

return nil

} return UITargetedDragPreview(view: getMessageView(for: message))

}

Page 35: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...
Page 36: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...
Page 37: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegate

Page 38: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegatefunc dragInteraction(_ interaction: UIDragInteraction, itemsForBeginning session: UIDragSession) -> [UIDragItem] {

let itemProvider = NSItemProvider(file)

Page 39: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegatefunc dragInteraction(_ interaction: UIDragInteraction, itemsForBeginning session: UIDragSession) -> [UIDragItem] {

let itemProvider = NSItemProvider(file) // Available in the next seed

itemProvider.preferredPresentationSize = CGSize(width: 400, height: 300)

Page 40: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegatefunc dragInteraction(_ interaction: UIDragInteraction, itemsForBeginning session: UIDragSession) -> [UIDragItem] {

let itemProvider = NSItemProvider(file) // Available in the next seed

itemProvider.preferredPresentationSize = CGSize(width: 400, height: 300)

let dragItem = UIDragItem(itemProvider: itemProvider) return [ dragItem ]}

Page 41: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Wenson Hsieh, WebKit

•Demo

Page 42: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Robb Böhnke, UIKit

•Customizing Drag Visuals

Page 43: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Animating Alongside the Lift

The view being lifted is live

Lift is interactive

Page 44: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegate

Page 45: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegatefunc dragInteraction(_ interaction: UIDragInteraction, willAnimateLiftWith animator: UIDragAnimating, session: UIDragSession) {

Page 46: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegatefunc dragInteraction(_ interaction: UIDragInteraction, willAnimateLiftWith animator: UIDragAnimating, session: UIDragSession) { session.items.lazy

Page 47: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegatefunc dragInteraction(_ interaction: UIDragInteraction, willAnimateLiftWith animator: UIDragAnimating, session: UIDragSession) { session.items.lazy .flatMap { $0.localObject as? Message }

Page 48: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegatefunc dragInteraction(_ interaction: UIDragInteraction, willAnimateLiftWith animator: UIDragAnimating, session: UIDragSession) { session.items.lazy .flatMap { $0.localObject as? Message } .map(getMessageView)

Page 49: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegatefunc dragInteraction(_ interaction: UIDragInteraction, willAnimateLiftWith animator: UIDragAnimating, session: UIDragSession) { session.items.lazy .flatMap { $0.localObject as? Message } .map(getMessageView) .forEach { messageView in

Page 50: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegatefunc dragInteraction(_ interaction: UIDragInteraction, willAnimateLiftWith animator: UIDragAnimating, session: UIDragSession) { session.items.lazy .flatMap { $0.localObject as? Message } .map(getMessageView) .forEach { messageView in animator.addAnimations {

messageView.overlay.alpha = 0

}

Page 51: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegatefunc dragInteraction(_ interaction: UIDragInteraction, willAnimateLiftWith animator: UIDragAnimating, session: UIDragSession) { session.items.lazy .flatMap { $0.localObject as? Message } .map(getMessageView) .forEach { messageView in animator.addAnimations {

messageView.overlay.alpha = 0

}

animator.addCompletion { position in

messageView.overlay.alpha = 1

}

}

}

Page 52: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

UITargetedDragPreview

Page 53: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

UITargetedDragPreview

View

Page 54: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

UITargetedDragPreview

View

Parameters

Page 55: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

UITargetedDragPreview

View

Parameters

Target

Page 56: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

UITargetedDragPreview

View

Parameters

Target

Page 57: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

UIDragPreviewParameters

Can color the background behind the view

Knows which portion of the preview is visible

Page 58: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

UIDragPreviewParameters

Page 59: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

UIDragPreviewParameters

Page 60: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

UIDragPreviewParameters

Page 61: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

UIDragPreviewParameters

Page 62: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

UIDragPreviewParameters

(592, 286)

Page 63: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

UIDragPreviewParameters

(592, 286)

Page 64: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

UIDragPreviewParameters

Page 65: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

UIDragPreviewParameters

Page 66: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

UIDragPreviewParameters

Page 67: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

UIDragPreviewParameters

(-50, -50)

Page 68: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

UIDragPreviewParameters

Page 69: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

UIDragPreviewParameters

Can color the background behind the view

Knows which portion of the preview is visible • Special style for text

Page 70: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

UITargetedDragPreview

View

Parameters

Target

Page 71: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

UIDragPreviewTarget

Knows where the preview is going to or coming from

Positions the preview inside its container

May apply a transform during set down

Page 72: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Positioning with a Target

Page 73: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Positioning with a Target

Page 74: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Positioning with a Target

Page 75: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Positioning with a Target

Page 76: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Positioning with a Target

Page 77: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Positioning with a Target

Page 78: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Positioning with a Target

Page 79: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Positioning with a Target

Page 80: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...
Page 81: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...
Page 82: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

UIDragPreview

Used to update previews while in flight

Does not have a target

Page 83: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegate

Page 84: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegatefunc dragInteraction(_ interaction: UIDragInteraction, sessionDidMove session: UIDragSession) {

Page 85: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegatefunc dragInteraction(_ interaction: UIDragInteraction, sessionDidMove session: UIDragSession) { guard !listView.bounds.contains(session.location(in: listView)) else { return }

Page 86: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegatefunc dragInteraction(_ interaction: UIDragInteraction, sessionDidMove session: UIDragSession) { guard !listView.bounds.contains(session.location(in: listView)) else { return }

for item in session.items where item.localObject is Message {

Page 87: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegatefunc dragInteraction(_ interaction: UIDragInteraction, sessionDidMove session: UIDragSession) { guard !listView.bounds.contains(session.location(in: listView)) else { return }

for item in session.items where item.localObject is Message { guard !updatedItems.contains(item) else { continue }

Page 88: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegatefunc dragInteraction(_ interaction: UIDragInteraction, sessionDidMove session: UIDragSession) { guard !listView.bounds.contains(session.location(in: listView)) else { return }

for item in session.items where item.localObject is Message { guard !updatedItems.contains(item) else { continue }

item.previewProvider = {

Page 89: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegatefunc dragInteraction(_ interaction: UIDragInteraction, sessionDidMove session: UIDragSession) { guard !listView.bounds.contains(session.location(in: listView)) else { return }

for item in session.items where item.localObject is Message { guard !updatedItems.contains(item) else { continue }

item.previewProvider = { let imageView = UIImageView(image: UIImage(named: "envelope"))

Page 90: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegatefunc dragInteraction(_ interaction: UIDragInteraction, sessionDidMove session: UIDragSession) { guard !listView.bounds.contains(session.location(in: listView)) else { return }

for item in session.items where item.localObject is Message { guard !updatedItems.contains(item) else { continue }

item.previewProvider = { let imageView = UIImageView(image: UIImage(named: "envelope"))

return UIDragPreview(view: imageView)

}

Page 91: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

// UIDragInteractionDelegatefunc dragInteraction(_ interaction: UIDragInteraction, sessionDidMove session: UIDragSession) { guard !listView.bounds.contains(session.location(in: listView)) else { return }

for item in session.items where item.localObject is Message { guard !updatedItems.contains(item) else { continue }

item.previewProvider = { let imageView = UIImageView(image: UIImage(named: "envelope"))

return UIDragPreview(view: imageView)

} updatedItems.add(item)

}

}

Page 92: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Wenson Hsieh, WebKit

•Demo

Page 93: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Tom Adriaenssen, UIKit

•Deep Dive into a Drop

Page 94: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Deep Dive into a Drop

Drop sessions

Performing a drop

Page 95: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Sessions

Page 96: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Sessions

Your access to all things drop • Drag location • Items • Configuration • Drag session (when local)

Page 97: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Sessions

Page 98: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

One interaction + delegate = one active drop session

Drop Sessions

Page 99: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

One interaction + delegate = one active drop session

Supporting more sessions? • Add more interactions • Set interaction.allowsSimultaneousDropSessions = true

Drop Sessions

Page 100: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Sessions Lifetime

Page 101: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Sessions Lifetime

Page 102: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Sessions Lifetime

optional func dropInteraction(_ interaction: UIDropInteraction, canHandle session: UIDropSession) -> Bool

can handle?

Page 103: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Sessions Lifetime

optional func dropInteraction(_ interaction: UIDropInteraction, canHandle session: UIDropSession) -> Bool

can handle?

Page 104: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Sessions Lifetime

optional func dropInteraction(_ interaction: UIDropInteraction, sessionDidEnter session: UIDropSession)

enter

can handle?

Page 105: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Sessions Lifetime

optional func dropInteraction(_ interaction: UIDropInteraction, sessionDidUpdate session: UIDropSession) -> UIDropProposal

update

enter

can handle?

Page 106: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Sessions Lifetime

drop

update

enter

can handle?

Page 107: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Sessions Lifetime

optional func dropInteraction(_ interaction: UIDropInteraction, sessionDidEnd session: UIDropSession)

end

drop

update

enter

can handle?

Page 108: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Sessions Lifetime

end

drop

update

enter

can handle?

Page 109: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Sessions Lifetime

end

drop

update

enter

can handle?

Page 110: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

exit

Drop Sessions Lifetime

optional func dropInteraction(_ interaction: UIDropInteraction, sessionDidExit session: UIDropSession)

end

drop

update

enter

can handle?

Page 111: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

exit

Drop Sessions Lifetime

optional func dropInteraction(_ interaction: UIDropInteraction, sessionDidEnd session: UIDropSession)

end

drop

update

enter

can handle?

Page 112: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

exit

Drop Sessions Lifetime

end

drop

update

enter

can handle?

Page 113: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Sessions Lifetime

exit

end

drop

update

enter

can handle?

Page 114: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Sessions Lifetime

exit

end

drop

update

enter

can handle?

Page 115: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Sessions Lifetime

exit

end

drop

update

enter

can handle?

Page 116: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Sessions Lifetime

exit

end

drop

update

enter

can handle?

Page 117: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Sessions Lifetime

exit

end

drop

update

enter

can handle?

Page 118: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

drop proposalupdate

Drop Sessions Lifetime

Page 119: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

drop proposal

update

Drop Sessions Lifetime

Page 120: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Proposals

class UIDropProposal : NSObject, NSCopying {

init(operation: UIDropOperation)

var operation: UIDropOperation { get }

var isPrecise: Bool var prefersFullSizePreview: Bool

}

Page 121: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop ProposalsPrecision mode

class UIDropProposal : NSObject, NSCopying {

init(operation: UIDropOperation)

var operation: UIDropOperation { get }

var isPrecise: Bool var prefersFullSizePreview: Bool

}

Page 122: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...
Page 123: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...
Page 124: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Proposals Preview scaling

class UIDropProposal : NSObject, NSCopying {

init(operation: UIDropOperation)

var operation: UIDropOperation { get }

var isPrecise: Bool var prefersFullSizePreview: Bool

}

Page 125: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Proposals Preview scaling

class UIDropProposal : NSObject, NSCopying {

init(operation: UIDropOperation)

var operation: UIDropOperation { get }

var isPrecise: Bool var prefersFullSizePreview: Bool

}

Page 126: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Proposals Preview scaling

class UIDropProposal : NSObject, NSCopying {

init(operation: UIDropOperation)

var operation: UIDropOperation { get }

var isPrecise: Bool var prefersFullSizePreview: Bool

}

Page 127: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...
Page 128: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...
Page 129: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Proposals Preview scaling

System prefers to scale down all previews

Prefer full-size previews when it makes sense

Page 130: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Proposals Preview scaling

System prefers to scale down all previews

Prefer full-size previews when it makes sense

optional func dragInteraction(_ interaction: UIDragInteraction, prefersFullSizePreviewsFor session: UIDragSession) -> Bool

class UIDropProposal : NSObject, NSCopying { var prefersFullSizePreview: Bool

}

Page 131: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Proposals Preview scaling

Page 132: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Flocks always scale

A single preview will always scale once it leaves the source app

Once scaled down, a preview never scales back up

Drop Proposals Preview scaling

Page 133: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Performing a Drop

time

Page 134: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Performing a Drop

optional func dropInteraction(_ interaction: UIDropInteraction, performDrop session: UIDropSession)

time

performDrop

Page 135: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Performing a Drop

optional func dropInteraction(_ interaction: UIDropInteraction, performDrop session: UIDropSession)

time

loadObject()

loadObject()

performDrop

Only time when you can request data

Always asynchronous

Don’t block!

Page 136: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Performing a Drop

time

loadObject()

loadObject()

animateperformDrop

Page 137: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Performing a Drop

57

time

loadObject()

loadObject()

animate concludeDropperformDrop

Page 138: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Performing a Drop

57

optional func dropInteraction(_ interaction: UIDropInteraction, concludeDrop session: UIDropSession)

time

loadObject()

loadObject()

animate concludeDropperformDrop

Page 139: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Performing a Drop

58

time

loadObject()

loadObject()

animate concludeDropperformDrop

Page 140: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Performing a Drop Loading homogeneous data

Page 141: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Performing a Drop Loading homogeneous data

•Use session’s loadObjects(ofClass:completion:)

•Load all objects conforming to a class

•Resulting array is sorted same as session’s items array

•Completion block will be called on main queue•⚠

Page 142: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Performing a Drop Loading heterogeneous data

Page 143: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Performing a Drop Loading heterogeneous data

•Iterate over session items and load each item individually •loadObject(), loadDataRepresentation(), loadFileRepresentation(), … •Fine-grained control

•Load multiple representations

•Completion block will be called on background queue•⚠

Page 144: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Performing a Drop Loading heterogeneous data

•Iterate over session items and load each item individually •loadObject(), loadDataRepresentation(), loadFileRepresentation(), … •Fine-grained control

•Load multiple representations

•Completion block will be called on background queue

Data Delivery with Drag and Drop Hall 2 Thursday 10:00AM

•⚠

Page 145: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Wenson Hsieh, WebKit

•Demo

Page 146: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Tom Adriaenssen, UIKit

•Drop Previews and Animations

Page 147: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Previews

63

time

loadObject()

loadObject()

animateperformDrop concludeDrop

Page 148: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Previews

64

time

loadObject()

loadObject()

animateperformDrop concludeDrop

Page 149: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Previews

65

time

loadObject()

loadObject()

performDrop previewForDropping concludeDrop

Page 150: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Previews

65

time

loadObject()

loadObject()

performDrop previewForDropping concludeDrop

optional func dropInteraction(_ interaction: UIDropInteraction, previewForDropping item: UIDragItem, withDefault defaultPreview: UITargetedDragPreview?) -> UITargetedDragPreview?

Page 151: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Previews

65

time

loadObject()

loadObject()

preview

preview

performDrop previewForDropping concludeDrop

optional func dropInteraction(_ interaction: UIDropInteraction, previewForDropping item: UIDragItem, withDefault defaultPreview: UITargetedDragPreview?) -> UITargetedDragPreview?

Page 152: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Previews

66

time

loadObject()

loadObject()

preview

preview

performDrop previewForDropping willAnimateDrop concludeDrop

Page 153: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Previews

66

time

loadObject()

loadObject()

preview

preview

performDrop previewForDropping willAnimateDrop concludeDrop

optional func dropInteraction(_ interaction: UIDropInteraction, item: UIDragItem, willAnimateDropWith animator: UIDragAnimating)

Page 154: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Previews

time

loadObject()

loadObject()

preview

preview

performDrop previewForDropping willAnimateDrop concludeDrop

Page 155: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Previews

optional func dropInteraction(_ interaction: UIDropInteraction, concludeDrop session: UIDropSession)

time

loadObject()

loadObject()

preview

preview

performDrop previewForDropping willAnimateDrop concludeDrop

Page 156: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Previews

time

loadObject()

loadObject()

preview

preview

performDrop previewForDropping willAnimateDrop concludeDrop

Page 157: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Previews… and Cancel Previews

optional func dropInteraction(_ interaction: UIDropInteraction, previewForDropping item: UIDragItem, withDefault defaultPreview: UITargetedDragPreview?) -> UITargetedDragPreview?

optional func dragInteraction(_ interaction: UIDragInteraction, previewForCancelling item: UIDragItem, withDefault defaultPreview: UITargetedDragPreview) -> UITargetedDragPreview?

Page 158: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Previews… and Cancel Previews

optional func dropInteraction(_ interaction: UIDropInteraction, previewForDropping item: UIDragItem, withDefault defaultPreview: UITargetedDragPreview?) -> UITargetedDragPreview?

optional func dragInteraction(_ interaction: UIDragInteraction, previewForCancelling item: UIDragItem, withDefault defaultPreview: UITargetedDragPreview) -> UITargetedDragPreview?

Page 159: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop Previews… and Cancel Previews

optional func dropInteraction(_ interaction: UIDropInteraction, previewForDropping item: UIDragItem, withDefault defaultPreview: UITargetedDragPreview?) -> UITargetedDragPreview?

optional func dragInteraction(_ interaction: UIDragInteraction, previewForCancelling item: UIDragItem, withDefault defaultPreview: UITargetedDragPreview) -> UITargetedDragPreview?

Same approach Different occasions

Page 160: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop and Cancel Previews Animating alongside

optional func dropInteraction(_ interaction: UIDropInteraction, item: UIDragItem, willAnimateDropWith animator: UIDragAnimating)

optional func dragInteraction(_ interaction: UIDragInteraction, item: UIDragItem, willAnimateCancelWith animator: UIDragAnimating)

Page 161: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop and Cancel Previews Animating alongside

optional func dropInteraction(_ interaction: UIDropInteraction, item: UIDragItem, willAnimateDropWith animator: UIDragAnimating)

optional func dragInteraction(_ interaction: UIDragInteraction, item: UIDragItem, willAnimateCancelWith animator: UIDragAnimating)

Called for each item in the flock

Similar in API to UIViewPropertyAnimator

Page 162: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop and Cancel Previews Animating alongside

optional func dropInteraction(_ interaction: UIDropInteraction, item: UIDragItem, willAnimateDropWith animator: UIDragAnimating)

optional func dragInteraction(_ interaction: UIDragInteraction, item: UIDragItem, willAnimateCancelWith animator: UIDragAnimating)

Called for each item in the flock

Similar in API to UIViewPropertyAnimator

Page 163: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop and Cancel Previews

Page 164: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop and Cancel Previews

Return defaultPreview

Page 165: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop and Cancel Previews

Return defaultPreview

Return nil

Page 166: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop and Cancel Previews

Return defaultPreview

Return nil

Retarget the defaultPreview

Page 167: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop and Cancel Previews

Return defaultPreview

Return nil

Retarget the defaultPreview

Make your own preview

Page 168: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop and Cancel Previews Some limits

Page 169: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop and Cancel Previews Some limits

Fewer items • Preview for each item • Alongside animations for each item

Page 170: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Drop and Cancel Previews Some limits

Fewer items • Preview for each item • Alongside animations for each item

More items • Default previews for all • One alongside animation

Page 171: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Wenson Hsieh, WebKit

•Demo

Page 172: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Tom Adriaenssen, UIKit

•Dealing with Slow Data Delivery

Page 173: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Dealing with Slow Data Delivery

Data loads are always asynchronous

Disconnected timelines • Data loading • Animating drop previews

Page 174: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Dealing with Slow Data Delivery

76

time

loadObject()

loadObject()

preview

preview

performDrop previewForDropping willAnimateDrop concludeDrop

Page 175: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...
Page 176: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...
Page 177: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Dealing with Slow Data Delivery Handling cancelling

Load completion blocks • Data will be nil • Error will be set

Page 178: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Dealing with Slow Data Delivery Handling cancelling

Session and items provide progress reporting • Session is ProgressReporting • Item provider load methods return Progress • Use Progress.cancellationHandler

Page 179: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Dealing with Slow Data Delivery Handling cancelling

Session and items provide progress reporting • Session is ProgressReporting • Item provider load methods return Progress • Use Progress.cancellationHandler

session

ProgressReporting

Page 180: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Dealing with Slow Data Delivery Handling cancelling

Session and items provide progress reporting • Session is ProgressReporting • Item provider load methods return Progress • Use Progress.cancellationHandler

session

loadObject()

loadDataRepresentation()

loadFileRepresentation()

ProgressReporting

Progress

Progress

Progress

Page 181: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Dealing with Slow Data Delivery Showing custom progress

session

ProgressReporting

loadObject()

loadDataRepresentation()

loadFileRepresentation()

Progress

Progress

Progress

Page 182: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Dealing with Slow Data Delivery Showing custom progress

session.progressIndicatorStyle = .none session

ProgressReporting

loadObject()

loadDataRepresentation()

loadFileRepresentation()

Progress

Progress

Progress

Page 183: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Dealing with Slow Data Delivery Showing custom progress

session.progressIndicatorStyle = .none session

ProgressReporting

Observe progress • session.progress • Per item: Progress returned by item provider

Allow the user to cancel the transfer

loadObject()

loadDataRepresentation()

loadFileRepresentation()

Progress

Progress

Progress

Page 184: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

“But— how can I generate a preview if I don’t have any data?”

Page 185: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Dealing with Slow Data Delivery Previews without data

Page 186: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Dealing with Slow Data Delivery Previews without data

Use and retarget the default previews

Page 187: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Dealing with Slow Data Delivery Previews without data

Use and retarget the default previews

Make a placeholder/progress preview

Drag and Drop with Collection and Table View Hall 2 Thursday 9:00AM

Page 188: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Dealing with Slow Data Delivery Previews without data

Use and retarget the default previews

Make a placeholder/progress preview

Never assume the data will be there

Drag and Drop with Collection and Table View Hall 2 Thursday 9:00AM

Page 189: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Dealing with Slow Data Delivery Previews without data

Use and retarget the default previews

Make a placeholder/progress preview

Never assume the data will be there

Always account for the worst case

Drag and Drop with Collection and Table View Hall 2 Thursday 9:00AM

Page 190: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...
Page 191: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...
Page 192: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

•Improved In-App Experience •by Adding Drag and Drop

Page 193: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

protocol UIDropSession : UIDragDropSession, ProgressReporting {

var localDragSession: UIDragSession? { get }

}

Improved In-App Experience Local drag and drop

Page 194: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

protocol UIDropSession : UIDragDropSession, ProgressReporting {

var localDragSession: UIDragSession? { get }

}

Access to corresponding drag session

nil for cross-app drags

Improved In-App Experience Local drag and drop

Page 195: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

class UIDragItem : NSObject {

var localObject: Any?

var itemProvider: NSItemProvider { get } }

Improved In-App Experience Local drag and drop

Page 196: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

class UIDragItem : NSObject {

var localObject: Any?

var itemProvider: NSItemProvider { get } }

App-local data carrier • State for drag • Transfer data between views

Provider fallback item provider (if drag can go outside app)

Improved In-App Experience Local drag and drop

Page 197: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

protocol UIDragSession : UIDragDropSession {

var localContext: Any? { get set }

}

Improved In-App Experience Local drag and drop

Page 198: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

protocol UIDragSession : UIDragDropSession {

var localContext: Any? { get set }

}

Usable for state that applies to this drag session only

Improved In-App Experience Local drag and drop

Page 199: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

optional func dragInteraction(_ interaction: UIDragInteraction, sessionIsRestrictedToDraggingApplication session: UIDragSession) -> Bool // default: false

var isRestrictedToDraggingApplication: Bool { get }

Restrict drag sessions to local application • Drop interactions in other apps won’t see the session

Improved In-App Experience Local drag and drop

Page 200: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

optional func dragInteraction(_ interaction: UIDragInteraction, sessionIsRestrictedToDraggingApplication session: UIDragSession) -> Bool // default: false

var isRestrictedToDraggingApplication: Bool { get }

Restrict drag sessions to local application • Drop interactions in other apps won’t see the session

Improved In-App Experience Local drag and drop

Page 201: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

optional func dragInteraction(_ interaction: UIDragInteraction, sessionIsRestrictedToDraggingApplication session: UIDragSession) -> Bool // default: false

var isRestrictedToDraggingApplication: Bool { get }

Restrict drag sessions to local application • Drop interactions in other apps won’t see the session

Improved In-App Experience Local drag and drop

Page 202: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

optional func dragInteraction(_ interaction: UIDragInteraction, sessionIsRestrictedToDraggingApplication session: UIDragSession) -> Bool // default: false

var isRestrictedToDraggingApplication: Bool { get }

Restrict drag sessions to local application • Drop interactions in other apps won’t see the session

Improved In-App Experience Local drag and drop

Page 203: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Improved In-App Experience Local drag and drop

Page 204: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

By default drag interactions are • Enabled on iPad • Disabled on iPhone

Improved In-App Experience Local drag and drop

Page 205: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

By default drag interactions are • Enabled on iPad • Disabled on iPhone

var isEnabled: Bool

class var isEnabledByDefault: Bool { get }

Improved In-App Experience Local drag and drop

Page 206: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Wenson Hsieh, WebKit

•Demo

Page 207: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Summary

Powerful, user-driven I/O for your app

Custom and stunning visuals and interactions

Asynchronous nature of data

Leverage Drag and Drop to improve in-app experience

Page 208: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

More Informationhttps://developer.apple.com/wwdc17/213

Page 209: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Related Sessions

Introducing Drag and Drop Hall 3 Tuesday 11:20AM

Drag and Drop with Collection and Table View Hall 2 Thursday 9:00AM

Data Delivery with Drag and Drop Hall 2 Thursday 10:00AM

Page 210: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

Labs

UIKit and Drag and Drop Lab Technology Lab C Tues 1:50PM-3:10PM

Cocoa Touch Lab Technology Lab I Wed 3:10-6:00PM

UIKit and Collection View Lab Technology Lab B Thur 10:00-12:30PM

Cocoa Touch and Haptics Lab Technology Lab C Fri 12:00-1:50PM

Page 211: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...

🎤💧

Page 212: Mastering Drag and Drop - Apple Inc....Mastering Drag and Drop • Session 213 App Frameworks NEW Drag and Drop API Roadmap Drag Session Drag Interaction Drag Interaction ...