Skip to content

Commit

Permalink
Create README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
insub4067 authored Mar 12, 2024
1 parent 09464cc commit 9906bdd
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# DragAndDropKit

## What is DragAndDropKit?
> DragAndDropKit allows you to implement drag and drop functionality easily in your SwiftUI projects without any effort.
## ✔️ Result
<img src="https://github.com/insub4067/DragAndDropKit/assets/85481204/fa0b1cec-6294-47f1-bff2-94c1a953fb07" width="300">

## ✔️ Example Code
```swift
struct DragAndDropPractice: View {

@State var items: [Item] = Array(1...20).map { Item(id: $0) }
@State var currentDragging: Item? = nil

var body: some View {
ScrollView {
LazyVStack(content: {
ForEach(items, id: \.self) { item in
Text("Placeholder \(item.id)")
.padding()
.frame(maxWidth: .infinity)
.frame(height: 100)
.background(Color.gray.opacity(0.6))
.dragAndDrop(
item: item,
items: $items,
currentDragging: $currentDragging)
}
})
}
}
}

struct Item: Identifiable, Hashable {
let id: Int
}
```

0 comments on commit 9906bdd

Please sign in to comment.