Reputation: 23
I am making drag & drop lazyVGrid.
i did reference this answer
SwiftUI | Using onDrag and onDrop to reorder Items within one single LazyGrid?
when drag move another item position it working well
but when I long press and not move and drop itself self.dragging not set to nil
how can I fix it??
Upvotes: 1
Views: 877
Reputation: 1256
I would try to do like this.
.gesture(DragGesture()
.onChanged({ value in
if value.x == 0 && value.y == 0 {
self.dragging = nil
}
})
)
Upvotes: 0