Drag and Drop using SwiftUI

Overview

I am bit confused regarding drag and drop on SwiftUI I think there are 2 approaches but I am stuck with both approaches

WWDC22

  • When using the new draggable, dropDestination, Transferable API, only single items are draggable. Multiple items in a list are not draggable. I have filed a feedback FB10128110

WWDC21

  • I have faced a couple of issues for drag and drop introduced in WWDC21 (onDrag, onDrop, itemIdentifier), the Feedback ids are FB9854301, FB9854569, FB9855245, FB9855532, FB9855567, FB9855575. It contains sample projects, would really appreciate if someone could have a look it.

Note: All feedbacks include a sample project with detail steps and some even have screenshots and videos

Questions:

If my approach is wrong or if I am missing something?

Unfortunately I didn't manage to get a SwiftUI lab session (got cancelled), so please help me with these issues.

Have you gotten any of this stuff to work for you? I started experimenting with accepting drops from outside my app, and it's been brick wall after brick wall.

Environment

  • macOS 13.0 Beta (22A5321d)
  • Xcode 14.0 beta 5 (14A5294e)

macOS

  • Single item drag and drop with in app - Works
  • Multiple items drag and drop in a list - Doesn't work - Bug
  • Drag and Drop from one app to another - Works
  • Drag and Drop from app to Finder - Doesn't work (only proxy representation works) - Bug

iOS Simulator

  • Single item drag and drop with in app - Works
  • Multiple items drag and drop in a list - Works
  • Drag and Drop from one app to another - Works
  • Drag and Drop from app to Finder - Works

Have you figured out how to overcome the single item limitation on macOS?

I'm on macOS 14.5 and it still seems to have the single-item-drag bug.

Just tested this on macOS 15 and seems to work fine. I am able to drag single / multiple items from a list and drop it on to a different list cell.

Note: I have not tested on

Could you post the minimum code so that I can try to understand what the issue is.

Drag and Drop using SwiftUI
 
 
Q