Drag and Drop Editable Lists: Tutorial for SwiftUI | raywenderlich.com

Grow your SwiftUI List skills beyond the basics. Implement editing, moving, deletion and drag-and-drop support. Then, learn how custom views can support draggable content.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/22408716-drag-and-drop-editable-lists-tutorial-for-swiftui
1 Like

One thing not mentioned that screwed me up. In TodoItem.swift, if you change the typeIdentifier from the value given in the starter project (com.raywenderlich…) to something else, you MUST use the same value in the Target->Info->Exported Type Identifiers. I couldn’t figure out why my app wasn’t dropping, and that was the problem.
Also, if you use List in ContentView.swift (rather than change to ScrollView), drag/drop sort of works - you can drop in the current focus ‘cell’, and can re-arrange todos within the Active group - you just can’t drag from Active to Completed (using Xcode 13 beta 5, with iOS 15 build target).

I was struggling with the same issue. This Raywenderlich article explains how to Export Your Own Type Identifier with more details.

Not working with Xcode 14.1 either. How about taking a look at this?( don’t mean you sbolin)