Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

KKBOX WWDC17 UIKit Drag and Drop - Mario


Published on

KKTV iOS 工程師 Mario 分享
相關 Sessions
- [Data Delivery with Drag and Drop] (
- [Drag and Drop with Collection and Table View] (
- [Introducing Drag and Drop] (
- [Mastering Drag and Drop] (

Published in: Technology
  • Sex in your area is here: ❶❶❶ ❶❶❶
    Are you sure you want to  Yes  No
    Your message goes here
  • Follow the link, new dating source: ❤❤❤ ❤❤❤
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

KKBOX WWDC17 UIKit Drag and Drop - Mario

  1. 1. Drag and Drop in iOS 11 Mario Tung KKTV
  2. 2. Summary - Goals for drag and drop - Different phases of a drag session - Essential Functions - Drag delegates - Drop delegates - Next step
  3. 3. What is drag and drop? A way to move data around
  4. 4. Goals for Drag and Drop Responsive - On demand / Async data transfer Secure - Source app can choose what data to transfer / who to transfer to - Data is only visible to destination Great multi touch experience - Deep integration with iOS apps - Multiple types of touch/gestures can be used
  5. 5. Demo
  6. 6. Phases of a drag session Data transfer time depends on file size
  7. 7. Drag begins: get data items - Use UIDragItems for transferring data - NSItemProvider only allows objects (not string structs)
  8. 8. Get drop proposal during session update - Called when touch point has moved in view / additional items are added - Return what to do when user drops item now - 4 types of UIDropOperations (Cancel / Copy / Move / Forbidden) - Move operation is only allowed within the same app
  9. 9. Perform the drop - Perform data transfer of objects
  10. 10. Customizing Drag and Drop - Use the drag interaction delegate to find out when views are lifted / being dragged around - Use drop interaction delegate to find out when an item has entered view / dropped into view
  11. 11. Drag interaction delegate - Lift - View to be shown when dragging
  12. 12. Drag interaction delegate - Session begins and moves
  13. 13. Drag interaction delegate - Adding more items - Add additional items to drag session - Update preview view accordingly
  14. 14. Drag interaction delegate - End session - Session is going to end with one of the four types of UIDropOperation
  15. 15. Drag interaction delegate - End session (Cancel)
  16. 16. Drag interaction delegate - End session (Copy/Move)
  17. 17. Drop interaction delegates
  18. 18. Drop interaction delegate - Session enters view - Can be used to filter out types of data that are accepted
  19. 19. Drop interaction delegate - Session enters/exits view - Enter/update/exit can happen multiple times - delegates will keep getting called
  20. 20. Drop interaction delegate - Drop animations - Execute any further UI changes to the UITargetedDragPreview from previewForLifting
  21. 21. Next step - exploring more