Sw

SwiftUI Reorderable – Pure SwiftUI Drag and Drop Components

Hacker News

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 card

Actual performance

1points
Did not reach leaderboard

Launch Intel predictions

Analyze your own launch →
Product HuntOn track for Day 1 leaderboard · Strong signals: new, using, code · Missing: mac, agents, macos
75%75% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Indie HackersFits the IH revenue-focused audience · Missing: supports, reddit linkedin, podcasting
68%68% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
TrustMRRLess likely to generate early MRR · Strong signals: month · Missing: mobile apps, ios, personal
49%49% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
Hacker NewsMay not resonate with HN audience · Strong signals: exist, ide, io · Missing: https docs, excited, just released
40%40% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
AppSumoMay struggle as an AppSumo deal · Missing: plus, platform, intuitive
37%37% predicted probability of success on AppSumo, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Missing: arr, mrr, revenue
13%13% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Correct prediction on native model

Similar products

To
Totally customisable CalendarView in SwiftUI29%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Totally customisable CalendarView in SwiftUI

Hacker News1
AI
AI for SwiftUI – Compot22%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

AI for SwiftUI – Compot

Hacker News2
Li
Library of SwiftUI Components and Templates36%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Library of SwiftUI Components and Templates

Hacker News1
1,
1,250 SwiftUI components, and an MCP that writes them into your app33%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

1,250 SwiftUI components, and an MCP that writes them into your app

Hacker News10
iO
iOS Roulette with SwiftUI29%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

iOS Roulette with SwiftUI

Hacker News1
I
I made a SwiftUI component so you can drag anywhere to dismiss a view35%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

I made a SwiftUI component so you can drag anywhere to dismiss a view

Hacker News2
Fo
Foldable and Expandable SwiftUI List37%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Foldable and Expandable SwiftUI List

Hacker News1
SwiftPieces
SwiftPieces56%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Open-source components for native SwiftUI apps

Indie Hackerscommitment-full-time
iO
iOS Game with SwiftUI36%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

iOS Game with SwiftUI

Hacker News1
A
A Gallery for SwiftUI31%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

A Gallery for SwiftUI

Hacker News4