SwiftUI Reorderable – Pure SwiftUI Drag and Drop Components
SwiftUI Reorderable – Pure SwiftUI Drag and Drop Components
Hey there! I made a Swift Package containing a UI component I built for an upcoming app I'm working on. It's my first time writing something serious using SwiftUI, and I've been annoyed with many of its limitations, especially when it comes to drag and drop. The native `onDrag` or `draggable` doesn't allow you to customize the gesture it uses [0], has a really opinionated and finicky preview, and sometimes fires `onDrag` more than once in a seemingly non-deterministic fashion [1]. A common answer to SwiftUI frustrations seems to be to just write a UIKit component instead. Given that a month ago, I knew neither SwiftUI nor UIKit and decided to go with the former, I didn't really want to start learning a second framework while barely mastering the first one. So, I got fed up and decided to write my own component instead. I was a little shocked by how few high-quality SwiftUI open-source components there are. Coming from a mainly web-development background, I expected to find components I could use, and if not, at least look at their code to figure out how it's done. It's possible components like these already exist, and I haven't found them. If that's the case, oh well. In any case, this was a good learning experience and I hope this component can help some of y'all! [0] https://stackoverflow.com/questions/65311379/how-to-customiz... [1] https://stackoverflow.com/questions/74087137/swiftui-ondrag-...
Share cardActual performance
Launch Intel predictions
Analyze your own launch →Correct prediction on native model
Similar products
Totally customisable CalendarView in SwiftUI
AI for SwiftUI – Compot
Library of SwiftUI Components and Templates
1,250 SwiftUI components, and an MCP that writes them into your app
iOS Roulette with SwiftUI
I made a SwiftUI component so you can drag anywhere to dismiss a view
Foldable and Expandable SwiftUI List
Open-source components for native SwiftUI apps
iOS Game with SwiftUI
A Gallery for SwiftUI