203 introduction to drag and drop 02 d...drag and drop on ios goals a great multi-touch experience...
TRANSCRIPT
![Page 1: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/1.jpg)
#WWDC17
© 2017 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple.
Bruce Nilo, UIKit Engineering Manager Kurt Revis, UIKit Engineer Emanuele Rudel, UIKit Engineer
•Introducing Drag and Drop • Session 203
App Frameworks
![Page 2: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/2.jpg)
•Goals and concepts •API fundamentals •Showing the APIs in action •Next steps
![Page 3: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/3.jpg)
What is Drag and Drop?
![Page 4: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/4.jpg)
What is Drag and Drop?
A way to graphically move or copy data
![Page 5: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/5.jpg)
Drag and Drop on iOS Goals
![Page 6: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/6.jpg)
Drag and Drop on iOS Goals
Responsive
![Page 7: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/7.jpg)
Drag and Drop on iOS Goals
Responsive• On demand and asynchronous data delivery
![Page 8: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/8.jpg)
Drag and Drop on iOS Goals
Responsive
Secure
![Page 9: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/9.jpg)
Drag and Drop on iOS Goals
Responsive
Secure• Data is only visible to destination
![Page 10: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/10.jpg)
Drag and Drop on iOS Goals
Responsive
Secure• Data is only visible to destination• Source may restrict access
![Page 11: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/11.jpg)
Drag and Drop on iOS Goals
Responsive
Secure
A great Multi-Touch experience
![Page 12: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/12.jpg)
![Page 13: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/13.jpg)
![Page 14: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/14.jpg)
Drag and Drop on iOS Goals
![Page 15: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/15.jpg)
Drag and Drop on iOS Goals
A great Multi-Touch experience
![Page 16: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/16.jpg)
Drag and Drop on iOS Goals
A great Multi-Touch experience• The interface is live• Deep integration with all of iOS• Great visual feedback• Hover to navigate• Items can be added• Transfer drags between fingers• Multiple drag interactions
![Page 17: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/17.jpg)
Drag and Drop on iOS
Vs.
![Page 18: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/18.jpg)
•Concepts
![Page 19: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/19.jpg)
Drag and Drop on iOS Phases of a drag session
![Page 20: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/20.jpg)
Lift Drag Set Down Data Transfer
Drag and Drop on iOS Phases of a drag session
![Page 21: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/21.jpg)
Long press
Lift preview
Lift Drag Set Down Data Transfer
Drag and Drop on iOS Phases of a drag session
![Page 22: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/22.jpg)
Long press
Lift preview
Previews
Tap to add
Spring-loading
Lift Drag Set Down Data Transfer
Drag and Drop on iOS Phases of a drag session
![Page 23: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/23.jpg)
Long press
Lift preview
Previews
Tap to add
Spring-loading
Cancel
Drop
Targeting
Lift Drag Set Down Data Transfer
Drag and Drop on iOS Phases of a drag session
![Page 24: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/24.jpg)
Long press
Lift preview
Previews
Tap to add
Spring-loading
Cancel
Drop
Targeting
Representations
Lazy delivery • Background • By File Provider
Progress
Lift Drag Set Down Data Transfer
Drag and Drop on iOS Phases of a drag session
![Page 25: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/25.jpg)
Enabling a Drag Concepts - interactions
Interaction
View
![Page 26: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/26.jpg)
Enabling a Drag Concepts - interactions
Input Interaction
View
![Page 27: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/27.jpg)
Enabling a Drag Concepts - UIDragInteraction
A drag interaction is attached to a view View
![Page 28: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/28.jpg)
Enabling a Drag Concepts - UIDragInteraction
A drag interaction is attached to a view
DragInteraction
Drag Interaction Delegate
View
![Page 29: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/29.jpg)
Enabling a Drag Concepts - UIDragInteraction
A drag interaction is attached to a view
DragInteraction
Drag Interaction Delegate
View
import UIKit
let view: UIView = ... let delegate: UIDragInteractionDelegate = ...
let dragInteraction = UIDragInteraction(delegate: delegate) view.addInteraction(dragInteraction)
![Page 30: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/30.jpg)
Lift Phase Concepts - UIDragInteraction
The delegate provides drag itemswhen the view lifts
DragInteraction
Drag Interaction Delegate
View
![Page 31: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/31.jpg)
DragItems
Lift Phase Concepts - UIDragInteraction
The delegate provides drag itemswhen the view lifts
No drag items -> drag gesture fails Drag
Interaction
Drag Interaction Delegate
View
![Page 32: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/32.jpg)
Drag Items Concepts - UIDragItem
DragItems
![Page 33: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/33.jpg)
Model Objects
Drag Items Concepts - UIDragItem
A drag item represents a model object
DragItems
![Page 34: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/34.jpg)
Drag Items Concepts - UIDragItem
A drag item represents a model object
A drag item embodies • Drag preview • Item provider
Model Objects
Previews
Item ProvidersDragItems
![Page 35: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/35.jpg)
Enabling a Drop Concepts - UIPasteConfiguration
![Page 36: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/36.jpg)
Enabling a Drop Concepts - UIPasteConfiguration
UIResponders have a new paste configuration property
Paste Configuration
View
![Page 37: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/37.jpg)
Enabling a Drop Concepts - UIPasteConfiguration
UIResponders have a new paste configuration property
// Indicate you can accept or paste strings
let config = UIPasteConfiguration(typeIdentifiersForAcceptingClass: NSString.self)view.pasteConfiguration = config
Paste Configuration
View
![Page 38: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/38.jpg)
Enabling a Drop Concepts - UIPasteConfiguration
UIResponders have a new paste configuration property
Paste Configuration
View
// Will be called for both Drag and Drop, and Copy/Paste
override func paste(itemProviders: [NSItemProvider]) {}
![Page 39: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/39.jpg)
Enabling a Drop Concepts - UIDropInteraction
A drop interaction is attached to a view
Drop Interaction
View
Drop Interaction Delegate
![Page 40: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/40.jpg)
Drag Phase Concepts - UIDropInteraction
The delegate responds to drag events
Drop Interaction
View
Drop Interaction Delegate
drag eventsDrop Proposal
![Page 41: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/41.jpg)
Set Down Phase Concepts - UIDropInteraction
On touch up, the drag session may be cancelled • The drag preview animates back
Drop Interaction
View
Drop Interaction Delegate
![Page 42: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/42.jpg)
Set Down Phase Concepts - UIDropInteraction
Or the drop is accepted • The delegate is told to perform drop
perform drop
Drop Interaction Delegate
![Page 43: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/43.jpg)
Data Transfer Phase Concepts - UIDropInteraction
Or the drop is accepted• The delegate is told to perform drop
perform drop
Drop Interaction Delegate
Item Provider
Drag Items
![Page 44: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/44.jpg)
Data Transfer Phase Concepts - UIDropInteraction
Or the drop is accepted• The delegate is told to perform drop
Delegate requests data representation of items
perform drop
Drop Interaction Delegate
Item Provider
Drag Items
Request Item
![Page 45: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/45.jpg)
Data Transfer Phase Concepts - UIDropInteraction
Or the drop is accepted• The delegate is told to perform drop
Delegate requests data representation of items
perform drop
Drop Interaction Delegate
Item Provider
Drag Items
AsynchronousData TransferRequest Item
![Page 46: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/46.jpg)
•API Roadmap
![Page 47: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/47.jpg)
API Roadmap
ItemProvider
DropSession
DragSession
DragInteraction
Drag Interaction Delegate Drag Item
Preview Drop Interaction
Drop Interaction Delegate
![Page 48: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/48.jpg)
Kurt Revis, UIKit Engineer
•Using the Drag and Drop API
![Page 49: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/49.jpg)
•Drag and drop timeline •API essentials •Introduction to the full API
![Page 50: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/50.jpg)
App BApp A
![Page 51: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/51.jpg)
App BApp A
![Page 52: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/52.jpg)
App BApp A
![Page 53: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/53.jpg)
App BApp A
![Page 54: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/54.jpg)
App BApp A
![Page 55: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/55.jpg)
App BApp A
![Page 56: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/56.jpg)
Drag and Drop Timeline
![Page 57: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/57.jpg)
Drag and Drop Timeline
Time
Touch Begins
![Page 58: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/58.jpg)
Drag and Drop Timeline
Dragand Drop
Time
Lift
Touch Begins
![Page 59: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/59.jpg)
Drag and Drop Timeline
Dragand Drop
Time
Stays Down
Lift
Touch Begins
![Page 60: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/60.jpg)
Drag and Drop Timeline
Dragand Drop
Time
Stays Down Moves
DragLift
Touch Begins
![Page 61: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/61.jpg)
Drag and Drop Timeline
Dragand Drop
Time
Stays Down Moves
DragLift
Touch Begins
![Page 62: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/62.jpg)
Drag and Drop Timeline
Dragand Drop
Time
Stays Down Moves Ends
DragLift
Touch Begins
![Page 63: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/63.jpg)
Drag and Drop Timeline
Dragand Drop
Time
Stays Down Moves Ends
DragLift
Touch Begins
![Page 64: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/64.jpg)
Drag and Drop Timeline
Dragand Drop
Time
Stays Down Moves Ends
DragLift
Touch BeginsLocation is not on a view
that accepts the drop
![Page 65: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/65.jpg)
Drag and Drop Timeline
Dragand Drop
Time
Stays Down Moves Ends
DragLift Cancel Animations
Touch BeginsLocation is not on a view
that accepts the drop
![Page 66: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/66.jpg)
Drag and Drop Timeline
Dragand Drop
Time
Stays Down Moves Ends
DragLift
Touch Begins
![Page 67: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/67.jpg)
Drag and Drop Timeline
Dragand Drop
Time
Stays Down Moves Ends
DragLift
Touch Begins
![Page 68: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/68.jpg)
Drag and Drop Timeline
Dragand Drop
Time
Stays Down Moves Ends
DragLift
Touch BeginsLocation is on a viewthat accepts the drop
![Page 69: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/69.jpg)
Drag and Drop Timeline
Dragand Drop
Time
Stays Down Moves Ends
DragLift Perform
Touch BeginsLocation is on a viewthat accepts the drop
![Page 70: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/70.jpg)
Drag and Drop Timeline
Dragand Drop
Time
Stays Down Moves Ends
DragLift Perform
Touch BeginsLocation is on a viewthat accepts the drop
![Page 71: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/71.jpg)
Drag and Drop Timeline
Dragand Drop
Time
Stays Down Moves Ends
DragLift Perform
Touch BeginsLocation is on a viewthat accepts the drop
Drop Animation
![Page 72: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/72.jpg)
Drag and Drop Timeline
Dragand Drop
Time
Stays Down Moves Ends
DragLift Perform
Data Transfer
Touch BeginsLocation is on a viewthat accepts the drop
Drop Animation
![Page 73: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/73.jpg)
Drag and Drop Timeline
Time
Perform Drop Animation
Data Transfer
![Page 74: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/74.jpg)
Drag and Drop Timeline
Time
Perform Drop Animation
Data Transfer
![Page 75: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/75.jpg)
Drag and Drop Timeline
Time
Perform Drop Animation
Data Transfer
![Page 76: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/76.jpg)
Drag and Drop Timeline
Dragand Drop
Time
Stays Down Moves Ends
DragLift Perform Drop Animations
Data Transfer
Cancel Animationsor
Touch Begins
![Page 77: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/77.jpg)
or
API Essentials—1
Dragand Drop
Time
Stays Down Moves Ends
DragLift Perform Drop Animations
Data Transfer
Cancel Animations
Touch Begins
![Page 78: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/78.jpg)
API Essentials—1 Get the items to drag
func dragInteraction(_ interaction: UIDragInteraction, itemsForBeginning session: UIDragSession) -> [UIDragItem]
![Page 79: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/79.jpg)
API Essentials—1 Get the items to drag
func dragInteraction(_ interaction: UIDragInteraction, itemsForBeginning session: UIDragSession) -> [UIDragItem]
![Page 80: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/80.jpg)
API Essentials—1 Get the items to drag
func dragInteraction(_ interaction: UIDragInteraction, itemsForBeginning session: UIDragSession) -> [UIDragItem] { let itemProvider = NSItemProvider(object: "Hello World" as NSString) let dragItem = UIDragItem(itemProvider: itemProvider) return [ dragItem ] }
![Page 81: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/81.jpg)
API Essentials—1 Get the items to drag
func dragInteraction(_ interaction: UIDragInteraction, itemsForBeginning session: UIDragSession) -> [UIDragItem] { let itemProvider = NSItemProvider(object: "Hello World" as NSString) let dragItem = UIDragItem(itemProvider: itemProvider) return [ dragItem ] }
![Page 82: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/82.jpg)
API Essentials—1 Get the items to drag
func dragInteraction(_ interaction: UIDragInteraction, itemsForBeginning session: UIDragSession) -> [UIDragItem] { let itemProvider = NSItemProvider(object: "Hello World" as NSString) let dragItem = UIDragItem(itemProvider: itemProvider) return [ dragItem ] }
![Page 83: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/83.jpg)
API Essentials—1 Get the items to drag
func dragInteraction(_ interaction: UIDragInteraction, itemsForBeginning session: UIDragSession) -> [UIDragItem] { let itemProvider = NSItemProvider(object: "Hello World" as NSString) let dragItem = UIDragItem(itemProvider: itemProvider) return [ dragItem ] }
![Page 84: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/84.jpg)
API Essentials—2
Dragand Drop
Time
Stays Down Moves Ends
DragLift Perform Drop Animations
Data Transfer
Cancel Animationsor
Touch Begins
![Page 85: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/85.jpg)
API Essentials—2 Get the drop proposal
func dropInteraction(_ interaction: UIDropInteraction, sessionDidUpdate session: UIDropSession) -> UIDropProposal { return UIDropProposal(operation: UIDropOperation)}
![Page 86: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/86.jpg)
API Essentials—2 Get the drop proposal
func dropInteraction(_ interaction: UIDropInteraction, sessionDidUpdate session: UIDropSession) -> UIDropProposal { return UIDropProposal(operation: UIDropOperation)}
![Page 87: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/87.jpg)
API Essentials—2 Get the drop proposal
func dropInteraction(_ interaction: UIDropInteraction, sessionDidUpdate session: UIDropSession) -> UIDropProposal { return UIDropProposal(operation: UIDropOperation)}
![Page 88: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/88.jpg)
API Essentials—2 UIDropOperation
![Page 89: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/89.jpg)
API Essentials—2 UIDropOperation
• .cancel • .copy • .move • .forbidden
![Page 90: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/90.jpg)
API Essentials—2 UIDropOperation
• .cancel • .copy • .move • .forbidden
![Page 91: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/91.jpg)
API Essentials—2 UIDropOperation
• .cancel • .copy • .move • .forbidden
![Page 92: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/92.jpg)
API Essentials—2 UIDropOperation
• .cancel • .copy • .move • .forbidden
![Page 93: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/93.jpg)
API Essentials—2 UIDropOperation
Delegates must cooperateto make it look like a move
• .move
![Page 94: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/94.jpg)
API Essentials—2 UIDropOperation
Delegates must cooperateto make it look like a move
Only within a single app
• .move
![Page 95: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/95.jpg)
API Essentials—2 UIDropOperation
Delegates must cooperateto make it look like a move
Only within a single app
Drag interaction delegatemust allow moves
• .move
![Page 96: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/96.jpg)
API Essentials—2 UIDropOperation
Delegates must cooperateto make it look like a move
Only within a single app
Drag interaction delegatemust allow moves
Drop interaction delegate checksUIDropSession allowsMoveOperation
• .move
![Page 97: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/97.jpg)
API Essentials—2 UIDropOperation
• .cancel • .copy • .move • .forbidden
![Page 98: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/98.jpg)
API Essentials—3
Dragand Drop
Time
Stays Down Moves Ends
DragLift Perform Drop Animations
Data Transfer
Cancel Animationsor
Touch Begins
![Page 99: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/99.jpg)
API Essentials—3 Perform the drop
func dropInteraction(_ interaction: UIDropInteraction, performDrop session: UIDropSession)
![Page 100: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/100.jpg)
API Essentials—3 Perform the drop
func dropInteraction(_ interaction: UIDropInteraction, performDrop session: UIDropSession)
![Page 101: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/101.jpg)
API Essentials—3 Perform the drop
func dropInteraction(_ interaction: UIDropInteraction, performDrop session: UIDropSession) { session.loadObjects(ofClass: UIImage.self) { objects in for image in objects as! [UIImage] { self.imageView.image = image } } }
![Page 102: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/102.jpg)
API Essentials—3 Perform the drop
func dropInteraction(_ interaction: UIDropInteraction, performDrop session: UIDropSession) { session.loadObjects(ofClass: UIImage.self) { objects in for image in objects as! [UIImage] { self.imageView.image = image } } }
![Page 103: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/103.jpg)
API Essentials—3 Perform the drop
func dropInteraction(_ interaction: UIDropInteraction, performDrop session: UIDropSession) { session.loadObjects(ofClass: UIImage.self) { objects in for image in objects as! [UIImage] { self.imageView.image = image } } }
![Page 104: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/104.jpg)
API Essentials—3 Perform the drop
func dropInteraction(_ interaction: UIDropInteraction, performDrop session: UIDropSession) { session.loadObjects(ofClass: UIImage.self) { objects in for image in objects as! [UIImage] { self.imageView.image = image } } }
![Page 105: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/105.jpg)
API Essentials—3 Perform the drop
func dropInteraction(_ interaction: UIDropInteraction, performDrop session: UIDropSession) { for item in session.items { item.itemProvider.loadObject(ofClass: UIImage.self) { (object, error) in if object != nil { DispatchQueue.main.async { self.imageView.image = (object as! UIImage) } } else { // Handle the error } } }
![Page 106: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/106.jpg)
API Essentials—3 Perform the drop
func dropInteraction(_ interaction: UIDropInteraction, performDrop session: UIDropSession) { for item in session.items { item.itemProvider.loadObject(ofClass: UIImage.self) { (object, error) in if object != nil { DispatchQueue.main.async { self.imageView.image = (object as! UIImage) } } else { // Handle the error } } }
![Page 107: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/107.jpg)
API Essentials—3 Perform the drop
func dropInteraction(_ interaction: UIDropInteraction, performDrop session: UIDropSession) { for item in session.items { item.itemProvider.loadObject(ofClass: UIImage.self) { (object, error) in if object != nil { DispatchQueue.main.async { self.imageView.image = (object as! UIImage) } } else { // Handle the error } } }
![Page 108: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/108.jpg)
API Essentials—3 Perform the drop
func dropInteraction(_ interaction: UIDropInteraction, performDrop session: UIDropSession) { for item in session.items { item.itemProvider.loadObject(ofClass: UIImage.self) { (object, error) in if object != nil { DispatchQueue.main.async { self.imageView.image = (object as! UIImage) } } else { // Handle the error } } }
![Page 109: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/109.jpg)
API Essentials—3 Perform the drop
func dropInteraction(_ interaction: UIDropInteraction, performDrop session: UIDropSession) { for item in session.items { item.itemProvider.loadObject(ofClass: UIImage.self) { (object, error) in if object != nil { DispatchQueue.main.async { self.imageView.image = (object as! UIImage) } } else { // Handle the error } } }
![Page 110: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/110.jpg)
API Essentials
Dragand Drop
Time
Stays Down Moves Ends
DragLift Perform Drop Animations
Data Transfer
Cancel Animationsor
Touch Begins
![Page 111: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/111.jpg)
API Essentials
Dragand Drop
Time
Stays Down Moves Ends
DragLift Perform Drop Animations
Data Transfer
Cancel Animationsor
Touch Begins
Get itemsto drag
![Page 112: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/112.jpg)
API Essentials
Dragand Drop
Time
Stays Down Moves Ends
DragLift Perform Drop Animations
Data Transfer
Cancel Animationsor
Touch Begins
Get itemsto drag
Get a drop proposal
![Page 113: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/113.jpg)
API Essentials
Dragand Drop
Time
Stays Down Moves Ends
DragLift Perform Drop Animations
Data Transfer
Cancel Animationsor
Touch Begins
Get itemsto drag
Get a drop proposal
Performdrop
![Page 114: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/114.jpg)
•Drag Interaction Delegate
![Page 115: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/115.jpg)
Drag Interaction Delegate Lift
func dragInteraction(_ interaction:UIDragInteraction, previewForLifting item:UIDragItem, session:UIDragSession) -> UITargetedDragPreview?
![Page 116: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/116.jpg)
Drag Interaction Delegate Lift
func dragInteraction(_ interaction:UIDragInteraction, previewForLifting item:UIDragItem, session:UIDragSession) -> UITargetedDragPreview?
![Page 117: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/117.jpg)
Drag Interaction Delegate Lift
func dragInteraction(_ interaction:UIDragInteraction, previewForLifting item:UIDragItem, session:UIDragSession) -> UITargetedDragPreview?
![Page 118: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/118.jpg)
Drag Interaction Delegate Lift
func dragInteraction(_ interaction:UIDragInteraction, previewForLifting item:UIDragItem, session:UIDragSession) -> UITargetedDragPreview? { let imageView = UIImageView(image: UIImage(named: "MyDragImage")) let dragView = interaction.view! let dragPoint = session.location(in: dragView) let target = UIDragPreviewTarget(container: dragView, center: dragPoint) return UITargetedDragPreview(view: imageView, parameters:UIDragPreviewParameters(), target:target) }
![Page 119: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/119.jpg)
Drag Interaction Delegate Lift
func dragInteraction(_ interaction:UIDragInteraction, previewForLifting item:UIDragItem, session:UIDragSession) -> UITargetedDragPreview? { let imageView = UIImageView(image: UIImage(named: "MyDragImage")) let dragView = interaction.view! let dragPoint = session.location(in: dragView) let target = UIDragPreviewTarget(container: dragView, center: dragPoint) return UITargetedDragPreview(view: imageView, parameters:UIDragPreviewParameters(), target:target) }
![Page 120: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/120.jpg)
Drag Interaction Delegate Lift
func dragInteraction(_ interaction:UIDragInteraction, previewForLifting item:UIDragItem, session:UIDragSession) -> UITargetedDragPreview? { let imageView = UIImageView(image: UIImage(named: "MyDragImage")) let dragView = interaction.view! let dragPoint = session.location(in: dragView) let target = UIDragPreviewTarget(container: dragView, center: dragPoint) return UITargetedDragPreview(view: imageView, parameters:UIDragPreviewParameters(), target:target) }
![Page 121: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/121.jpg)
Drag Interaction Delegate Lift
func dragInteraction(_ interaction:UIDragInteraction, previewForLifting item:UIDragItem, session:UIDragSession) -> UITargetedDragPreview? { let imageView = UIImageView(image: UIImage(named: "MyDragImage")) let dragView = interaction.view! let dragPoint = session.location(in: dragView) let target = UIDragPreviewTarget(container: dragView, center: dragPoint) return UITargetedDragPreview(view: imageView, parameters:UIDragPreviewParameters(), target:target) }
![Page 122: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/122.jpg)
Drag Interaction Delegate Lift
func dragInteraction(_ interaction:UIDragInteraction, previewForLifting item:UIDragItem, session:UIDragSession) -> UITargetedDragPreview? { let imageView = UIImageView(image: UIImage(named: "MyDragImage")) let dragView = interaction.view! let dragPoint = session.location(in: dragView) let target = UIDragPreviewTarget(container: dragView, center: dragPoint) return UITargetedDragPreview(view: imageView, parameters:UIDragPreviewParameters(), target:target) }
![Page 123: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/123.jpg)
Drag Interaction Delegate Lift
func dragInteraction(_ interaction: UIDragInteraction, willAnimateLiftWith animator: UIDragAnimating, session: UIDragSession) { animator.addAnimations { self.view.backgroundColor = UIColor.gray } animator.addCompletion { position in if position == .end { // The lift ended normally, and a drag is now happening } else if position == .start { // The lift was cancelled and the animation returned to the start } }}
![Page 124: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/124.jpg)
Drag Interaction Delegate Lift
func dragInteraction(_ interaction: UIDragInteraction, willAnimateLiftWith animator: UIDragAnimating, session: UIDragSession) { animator.addAnimations { self.view.backgroundColor = UIColor.gray } animator.addCompletion { position in if position == .end { // The lift ended normally, and a drag is now happening } else if position == .start { // The lift was cancelled and the animation returned to the start } }}
![Page 125: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/125.jpg)
Drag Interaction Delegate Lift
func dragInteraction(_ interaction: UIDragInteraction, willAnimateLiftWith animator: UIDragAnimating, session: UIDragSession) { animator.addAnimations { self.view.backgroundColor = UIColor.gray } animator.addCompletion { position in if position == .end { // The lift ended normally, and a drag is now happening } else if position == .start { // The lift was cancelled and the animation returned to the start } }}
![Page 126: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/126.jpg)
Drag Interaction Delegate Lift
func dragInteraction(_ interaction: UIDragInteraction, willAnimateLiftWith animator: UIDragAnimating, session: UIDragSession) { animator.addAnimations { self.view.backgroundColor = UIColor.gray } animator.addCompletion { position in if position == .end { // The lift ended normally, and a drag is now happening } else if position == .start { // The lift was cancelled and the animation returned to the start } }}
![Page 127: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/127.jpg)
Drag Interaction Delegate Session begins and moves
func dragInteraction(_ interaction: UIDragInteraction, sessionWillBegin session: UIDragSession)
func dragInteraction(_ interaction: UIDragInteraction, sessionAllowsMoveOperation session: UIDragSession) -> Bool // And more methods asking questions about the new drag session
func dragInteraction(_ interaction: UIDragInteraction, sessionDidMove session: UIDragSession)
![Page 128: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/128.jpg)
Drag Interaction Delegate Session begins and moves
func dragInteraction(_ interaction: UIDragInteraction, sessionWillBegin session: UIDragSession)
func dragInteraction(_ interaction: UIDragInteraction, sessionAllowsMoveOperation session: UIDragSession) -> Bool // And more methods asking questions about the new drag session
func dragInteraction(_ interaction: UIDragInteraction, sessionDidMove session: UIDragSession)
![Page 129: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/129.jpg)
Drag Interaction Delegate Session begins and moves
func dragInteraction(_ interaction: UIDragInteraction, sessionWillBegin session: UIDragSession)
func dragInteraction(_ interaction: UIDragInteraction, sessionAllowsMoveOperation session: UIDragSession) -> Bool // And more methods asking questions about the new drag session
func dragInteraction(_ interaction: UIDragInteraction, sessionDidMove session: UIDragSession)
![Page 130: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/130.jpg)
Drag Interaction Delegate Session begins and moves
func dragInteraction(_ interaction: UIDragInteraction, sessionWillBegin session: UIDragSession)
func dragInteraction(_ interaction: UIDragInteraction, sessionAllowsMoveOperation session: UIDragSession) -> Bool // And more methods asking questions about the new drag session
func dragInteraction(_ interaction: UIDragInteraction, sessionDidMove session: UIDragSession)
![Page 131: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/131.jpg)
Drag Interaction Delegate Adding items
Touch 2
Time
Stays Down MovesTouch Begins
Dragand Drop
DragLift
![Page 132: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/132.jpg)
Drag Interaction Delegate Adding items
Touch 2
Time
Stays Down Moves
Tap
Touch Begins
Dragand Drop
DragLift
![Page 133: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/133.jpg)
Drag Interaction Delegate Adding items
Touch 2
Time
Stays Down Moves
Tap
Touch Begins
Get items to add
Dragand Drop
DragLift
![Page 134: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/134.jpg)
Drag Interaction Delegate Adding items during the session
func dragInteraction(_ interaction: UIDragInteraction, itemsForAddingTo session: UIDragSession, withTouchAt point: CGPoint) -> [UIDragItem]
func dragInteraction(_ interaction:UIDragInteraction, previewForLifting item:UIDragItem, session:UIDragSession) -> UITargetedDragPreview?
![Page 135: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/135.jpg)
Drag Interaction Delegate Adding items during the session
func dragInteraction(_ interaction: UIDragInteraction, itemsForAddingTo session: UIDragSession, withTouchAt point: CGPoint) -> [UIDragItem]
func dragInteraction(_ interaction:UIDragInteraction, previewForLifting item:UIDragItem, session:UIDragSession) -> UITargetedDragPreview?
![Page 136: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/136.jpg)
Drag Interaction Delegate Adding items during the session
func dragInteraction(_ interaction: UIDragInteraction, itemsForAddingTo session: UIDragSession, withTouchAt point: CGPoint) -> [UIDragItem]
func dragInteraction(_ interaction:UIDragInteraction, previewForLifting item:UIDragItem, session:UIDragSession) -> UITargetedDragPreview?
![Page 137: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/137.jpg)
Drag Interaction Delegate The session ends
func dragInteraction(_ interaction: UIDragInteraction, session: UIDragSession, willEndWith operation: UIDropOperation)
![Page 138: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/138.jpg)
Drag Interaction Delegate The session ends
func dragInteraction(_ interaction: UIDragInteraction, session: UIDragSession, willEndWith operation: UIDropOperation)
![Page 139: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/139.jpg)
Drag Interaction Delegate The session ends in a cancel
func dragInteraction(_ interaction: UIDragInteraction, previewForCancelling item: UIDragItem, withDefault defaultPreview: UITargetedDragPreview) -> UITargetedDragPreview?
func dragInteraction(_ interaction: UIDragInteraction, item: UIDragItem, willAnimateCancelWith animator: UIDragAnimating)
func dragInteraction(_ interaction: UIDragInteraction, session: UIDragSession didEndWith operation: UIDropOperation)
![Page 140: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/140.jpg)
Drag Interaction Delegate The session ends in a cancel
func dragInteraction(_ interaction: UIDragInteraction, previewForCancelling item: UIDragItem, withDefault defaultPreview: UITargetedDragPreview) -> UITargetedDragPreview?
func dragInteraction(_ interaction: UIDragInteraction, item: UIDragItem, willAnimateCancelWith animator: UIDragAnimating)
func dragInteraction(_ interaction: UIDragInteraction, session: UIDragSession didEndWith operation: UIDropOperation)
![Page 141: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/141.jpg)
Drag Interaction Delegate The session ends in a cancel
func dragInteraction(_ interaction: UIDragInteraction, previewForCancelling item: UIDragItem, withDefault defaultPreview: UITargetedDragPreview) -> UITargetedDragPreview?
func dragInteraction(_ interaction: UIDragInteraction, item: UIDragItem, willAnimateCancelWith animator: UIDragAnimating)
func dragInteraction(_ interaction: UIDragInteraction, session: UIDragSession didEndWith operation: UIDropOperation)
![Page 142: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/142.jpg)
Drag Interaction Delegate The session ends in a cancel
func dragInteraction(_ interaction: UIDragInteraction, previewForCancelling item: UIDragItem, withDefault defaultPreview: UITargetedDragPreview) -> UITargetedDragPreview?
func dragInteraction(_ interaction: UIDragInteraction, item: UIDragItem, willAnimateCancelWith animator: UIDragAnimating)
func dragInteraction(_ interaction: UIDragInteraction, session: UIDragSession didEndWith operation: UIDropOperation)
![Page 143: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/143.jpg)
Drag Interaction Delegate The session ends in a copy or move
func dragInteraction(_ interaction: UIDragInteraction, session: UIDragSession didEndWith operation: UIDropOperation)
func dragInteraction(_ interaction: UIDragInteraction, sessionDidTransferItems session: UIDragSession)
![Page 144: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/144.jpg)
Drag Interaction Delegate The session ends in a copy or move
func dragInteraction(_ interaction: UIDragInteraction, session: UIDragSession didEndWith operation: UIDropOperation)
func dragInteraction(_ interaction: UIDragInteraction, sessionDidTransferItems session: UIDragSession)
![Page 145: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/145.jpg)
Drag Interaction Delegate The session ends in a copy or move
func dragInteraction(_ interaction: UIDragInteraction, session: UIDragSession didEndWith operation: UIDropOperation)
func dragInteraction(_ interaction: UIDragInteraction, sessionDidTransferItems session: UIDragSession)
![Page 146: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/146.jpg)
•Drop Interaction Delegate
![Page 147: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/147.jpg)
App BApp A
View 1
View 2
View 3
![Page 148: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/148.jpg)
App BApp A
View 1
View 2
View 3
![Page 149: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/149.jpg)
App BApp A
View 1
View 2
View 3
![Page 150: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/150.jpg)
App BApp A
View 1
View 2
View 3
![Page 151: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/151.jpg)
Drop Interaction Delegate Session enters the view
func dropInteraction(_ interaction: UIDropInteraction, canHandle session: UIDropSession) -> Bool { return session.canLoadObjects(ofClass: UIImage.self)}
![Page 152: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/152.jpg)
Drop Interaction Delegate Session enters the view
func dropInteraction(_ interaction: UIDropInteraction, canHandle session: UIDropSession) -> Bool { return session.canLoadObjects(ofClass: UIImage.self)}
![Page 153: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/153.jpg)
Drop Interaction Delegate Session enters the view
func dropInteraction(_ interaction: UIDropInteraction, canHandle session: UIDropSession) -> Bool { return session.canLoadObjects(ofClass: UIImage.self)}
![Page 154: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/154.jpg)
Drop Interaction Delegate Session enters the view
import MobileCoreServices // for kUTTypeImagePNG
func dropInteraction(_ interaction: UIDropInteraction, canHandle session: UIDropSession) -> Bool { return session.hasItemsConforming(toTypeIdentifiers: [kUTTypeImagePNG as String]) }
![Page 155: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/155.jpg)
Drop Interaction Delegate Session enters the view
import MobileCoreServices // for kUTTypeImagePNG
func dropInteraction(_ interaction: UIDropInteraction, canHandle session: UIDropSession) -> Bool { return session.hasItemsConforming(toTypeIdentifiers: [kUTTypeImagePNG as String]) }
![Page 156: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/156.jpg)
Drop Interaction Delegate Session enters and exits the view
func dropInteraction(_ interaction: UIDropInteraction, sessionDidEnter session: UIDropSession)
func dropInteraction(_ interaction: UIDropInteraction, sessionDidUpdate session: UIDropSession) -> UIDropProposal
func dropInteraction(_ interaction: UIDropInteraction, sessionDidExit session: UIDropSession)
![Page 157: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/157.jpg)
Drop Interaction Delegate Session enters and exits the view
func dropInteraction(_ interaction: UIDropInteraction, sessionDidEnter session: UIDropSession)
func dropInteraction(_ interaction: UIDropInteraction, sessionDidUpdate session: UIDropSession) -> UIDropProposal
func dropInteraction(_ interaction: UIDropInteraction, sessionDidExit session: UIDropSession)
![Page 158: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/158.jpg)
Drop Interaction Delegate Session enters and exits the view
func dropInteraction(_ interaction: UIDropInteraction, sessionDidEnter session: UIDropSession)
func dropInteraction(_ interaction: UIDropInteraction, sessionDidUpdate session: UIDropSession) -> UIDropProposal
func dropInteraction(_ interaction: UIDropInteraction, sessionDidExit session: UIDropSession)
![Page 159: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/159.jpg)
Drop Interaction Delegate Session enters and exits the view
func dropInteraction(_ interaction: UIDropInteraction, sessionDidEnter session: UIDropSession)
func dropInteraction(_ interaction: UIDropInteraction, sessionDidUpdate session: UIDropSession) -> UIDropProposal
func dropInteraction(_ interaction: UIDropInteraction, sessionDidExit session: UIDropSession)
![Page 160: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/160.jpg)
Springloading When session hovers over a view
let button = UIButton() button.isSpringLoaded = true
let springLoadedInteraction = UISpringLoadedInteraction { (interaction, context) in // Activate springloading here}view.addInteraction(springLoadedInteraction)
![Page 161: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/161.jpg)
Springloading When session hovers over a view
let button = UIButton() button.isSpringLoaded = true
let springLoadedInteraction = UISpringLoadedInteraction { (interaction, context) in // Activate springloading here}view.addInteraction(springLoadedInteraction)
![Page 162: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/162.jpg)
Springloading When session hovers over a view
let button = UIButton() button.isSpringLoaded = true
let springLoadedInteraction = UISpringLoadedInteraction { (interaction, context) in // Activate springloading here}view.addInteraction(springLoadedInteraction)
![Page 163: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/163.jpg)
Springloading When session hovers over a view
let button = UIButton() button.isSpringLoaded = true
let springLoadedInteraction = UISpringLoadedInteraction { (interaction, context) in // Activate springloading here}view.addInteraction(springLoadedInteraction)
![Page 164: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/164.jpg)
Drop Interaction Delegate Session ends over a different view
func dropInteraction(_ interaction: UIDropInteraction, sessionDidEnd session: UIDropSession)
![Page 165: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/165.jpg)
Drop Interaction Delegate Session ends over a different view
func dropInteraction(_ interaction: UIDropInteraction, sessionDidEnd session: UIDropSession)
![Page 166: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/166.jpg)
Drop Interaction Delegate Session ends over this view
Dragand Drop
Time
Touch Ends
Perform Drop Animations
Data Transfer
![Page 167: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/167.jpg)
Drop Interaction Delegate Drop animations
func dropInteraction(_ interaction: UIDropInteraction, previewForDropping item: UIDragItem, withDefault defaultPreview: UITargetedDragPreview) -> UITargetedDragPreview?
func dropInteraction(_ interaction: UIDropInteraction, item: UIDragItem, willAnimateDropWith animator: UIDragAnimating)
func dropInteraction(_ interaction: UIDropInteraction, concludeDrop session: UIDropSession)
![Page 168: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/168.jpg)
Drop Interaction Delegate Drop animations
func dropInteraction(_ interaction: UIDropInteraction, previewForDropping item: UIDragItem, withDefault defaultPreview: UITargetedDragPreview) -> UITargetedDragPreview?
func dropInteraction(_ interaction: UIDropInteraction, item: UIDragItem, willAnimateDropWith animator: UIDragAnimating)
func dropInteraction(_ interaction: UIDropInteraction, concludeDrop session: UIDropSession)
![Page 169: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/169.jpg)
Drop Interaction Delegate Drop animations
func dropInteraction(_ interaction: UIDropInteraction, previewForDropping item: UIDragItem, withDefault defaultPreview: UITargetedDragPreview) -> UITargetedDragPreview?
func dropInteraction(_ interaction: UIDropInteraction, item: UIDragItem, willAnimateDropWith animator: UIDragAnimating)
func dropInteraction(_ interaction: UIDropInteraction, concludeDrop session: UIDropSession)
![Page 170: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/170.jpg)
Drop Interaction Delegate Drop animations
func dropInteraction(_ interaction: UIDropInteraction, previewForDropping item: UIDragItem, withDefault defaultPreview: UITargetedDragPreview) -> UITargetedDragPreview?
func dropInteraction(_ interaction: UIDropInteraction, item: UIDragItem, willAnimateDropWith animator: UIDragAnimating)
func dropInteraction(_ interaction: UIDropInteraction, concludeDrop session: UIDropSession)
![Page 171: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/171.jpg)
Drop Interaction Delegate Data transfer
let progress = item.itemProvider.loadObject(ofClass: UImage.self) { (object, error) in // Closure is called when object or error are available}
let fractionCompleted = progress.fractionCompletedlet isFinished = progress.isFinishedprogress.cancel()
let sessionProgress = session.progress
![Page 172: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/172.jpg)
Drop Interaction Delegate Data transfer
let progress = item.itemProvider.loadObject(ofClass: UImage.self) { (object, error) in // Closure is called when object or error are available}
let fractionCompleted = progress.fractionCompletedlet isFinished = progress.isFinishedprogress.cancel()
let sessionProgress = session.progress
![Page 173: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/173.jpg)
Drop Interaction Delegate Data transfer
let progress = item.itemProvider.loadObject(ofClass: UImage.self) { (object, error) in // Closure is called when object or error are available}
let fractionCompleted = progress.fractionCompletedlet isFinished = progress.isFinishedprogress.cancel()
let sessionProgress = session.progress
![Page 174: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/174.jpg)
Drop Interaction Delegate Data transfer
let progress = item.itemProvider.loadObject(ofClass: UImage.self) { (object, error) in // Closure is called when object or error are available}
let fractionCompleted = progress.fractionCompletedlet isFinished = progress.isFinishedprogress.cancel()
let sessionProgress = session.progress
![Page 175: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/175.jpg)
Drop Interaction Delegate Data transfer
let progress = item.itemProvider.loadObject(ofClass: UImage.self) { (object, error) in // Closure is called when object or error are available}
let fractionCompleted = progress.fractionCompletedlet isFinished = progress.isFinishedprogress.cancel()
let sessionProgress = session.progress
![Page 176: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/176.jpg)
Drop Interaction Delegate Data transfer
let progress = item.itemProvider.loadObject(ofClass: UImage.self) { (object, error) in // Closure is called when object or error are available}
let fractionCompleted = progress.fractionCompletedlet isFinished = progress.isFinishedprogress.cancel()
let sessionProgress = session.progress
![Page 177: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/177.jpg)
Drag and Drop Timeline
Dragand Drop
Time
Stays Down Moves Ends
DragLift Perform Drop Animations
Data Transfer
Cancel Animations
Touch Begins
or
![Page 178: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/178.jpg)
Interaction Delegates Essential functions
func dragInteraction(_ interaction: UIDragInteraction, itemsForBeginning session: UIDragSession) -> [UIDragItem]
func dropInteraction(_ interaction: UIDropInteraction, sessionDidUpdate session: UIDropSession) -> UIDropProposal
func dropInteraction(_ interaction: UIDropInteraction, performDrop session: UIDropSession)
![Page 179: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/179.jpg)
To customize drag and drop, use the interaction delegates.
![Page 180: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/180.jpg)
Emanuele Rudel, UIKit Engineer
•Demo
![Page 181: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/181.jpg)
Next Steps
![Page 182: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/182.jpg)
Next Steps
Explore the system
![Page 183: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/183.jpg)
Next Steps
Explore the system
Try adding a drop target
![Page 184: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/184.jpg)
Next Steps
Explore the system
Try adding a drop target
Enable a drag source
![Page 185: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/185.jpg)
Next Steps
Explore the system
Try adding a drop target
Enable a drag source
Spring load some of your controls
![Page 186: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/186.jpg)
Next Steps
Explore the system
Try adding a drop target
Enable a drag source
Spring load some of your controls
Dig deeper into the Drag and Drop APIs
![Page 187: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/187.jpg)
Explore the APIs
ItemProvider
DropSession
DragSession
DragInteraction
Drag Interaction Delegate Drag Item
Preview Drop Interaction
Drop Interaction Delegate
![Page 188: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/188.jpg)
Mastering Drag and Drop Executive Ballroom Wednesday 11:00AM
Explore the APIs
ItemProvider
DropSession
DragSession
DragInteraction
Drag Interaction Delegate Drag Item
Preview Drop Interaction
Drop Interaction Delegate
![Page 189: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/189.jpg)
Explore the APIs
ItemProvider
DropSession
DragSession
DragInteraction
Drag Interaction Delegate Drag Item
Preview Drop Interaction
Drop Interaction Delegate
![Page 190: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/190.jpg)
Explore the APIs
Data Delivery with Drag and Drop Hall 2 Thursday 10:00AM
ItemProvider
DropSession
DragSession
DragInteraction
Drag Interaction Delegate Drag Item
Preview Drop Interaction
Drop Interaction Delegate
![Page 191: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/191.jpg)
Explore the APIs
ItemProvider
DropSession
DragSession
DragInteraction
Drag Interaction Delegate Drag Item
Preview Drop Interaction
Drop Interaction Delegate
![Page 192: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/192.jpg)
Explore the APIs
UICollectionView UITableView UITextView UITextField WKWebView
ItemProvider
DropSession
DragSession
DragInteraction
Drag Interaction Delegate Drag Item
Preview Drop Interaction
Drop Interaction Delegate
![Page 193: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/193.jpg)
Explore the APIs
UICollectionView UITableView UITextView UITextField WKWebView
ItemProvider
DropSession
DragSession
DragInteraction
Drag Interaction Delegate Drag Item
Preview Drop Interaction
Drop Interaction Delegate
![Page 194: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/194.jpg)
Explore the APIs
UICollectionView UITableView UITextView UITextField WKWebView
Drag and Drop with Collection and Table View Hall 2 Thursday 9:00AM
ItemProvider
DropSession
DragSession
DragInteraction
Drag Interaction Delegate Drag Item
Preview Drop Interaction
Drop Interaction Delegate
![Page 195: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/195.jpg)
More Informationhttps://developer.apple.com/wwdc17/203
90
![Page 196: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/196.jpg)
Related Sessions
Mastering Drag and Drop Executive Ballroom Wednesday 11:00AM
Data Delivery with Drag and Drop Hall 2 Thursday 10:00AM
Drag and Drop with Collection and Table View Hall 2 Thursday 9:00AM
File Provider Enhancements Hall 3 Friday 11:00AM
What's New in Core Spotlight for iOS and macOS Grand Ballroom B Thursday 4:10PM
91
![Page 197: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/197.jpg)
Labs
92
UIKit and Drag and Drop Lab Technology Lab C Tues 1:50–4:10PM
Cocoa Touch Lab Technology Lab I Wed 3:10–6:00PM
UIKit and Collection View Lab Technology Lab B Thur 11:00AM–12:30PM
Cocoa Touch and Haptics Lab Technology Lab C Fri 12:00–1:50PM
![Page 198: 203 Introduction to Drag and Drop 02 D...Drag and Drop on iOS Goals A great Multi-Touch experience • The interface is live • Deep integration with all of iOS • Great visual feedback](https://reader034.vdocuments.us/reader034/viewer/2022052314/5f0f39ae7e708231d4431b99/html5/thumbnails/198.jpg)
93