SwiftUI: How to use onDrag and onDrop within Grids?
iOS 14 — Xcode 12.3
2 min readJan 23, 2021
In this tutorial we are going to implement a onDrag and onDrop to a grid. OnDrag and OnDrop can be used reorder grid with used case in managing playlist booklist etc.
Steps:
- Setup Mock data:
struct Grid: Identifiable {
var id = UUID().uuidString…