UICollectionView with SwiftUI + Drag and drop reordering possible?
问题 I'm implementing a UICollectionView inside my SwiftUI View (also with SwiftUI View cells). So I have a Hosting+Representable Combo. Now I want to reorder my cells through drag and drop, but nothing happens. The idea is to use a longpressGesture together with the given functions canMoveItemAt and moveItemAt. Here is the full code: import SwiftUI import UIKit struct ContentView: View { var body: some View { CollectionComponent() } } struct CollectionComponent : UIViewRepresentable { func