ReorderingVStack
No description available
Install / Use
/learn @atlou/ReorderingVStackREADME
ReorderingVStack
A simple SwiftUI view that lets you reorder items in a VStack with drag-and-drop.
Preview
<p align=center> <img src=https://github.com/user-attachments/assets/578c3393-f231-4fba-915f-01a5e6535368 width=100%> </p>Usage
import SwiftUI
import ReorderingVStack // import the package
struct ContentView: View {
@State private var items = Item.mocks // must conform to Hashable and Identifiable
var body: some View {
ReorderingVStack(items: $items, spacing: 10) {
ForEach(items, id: \.self) { item in
HStack {
Text(item.title)
Spacer()
Image(systemName: "line.3.horizontal")
.dragToReorder() // makes the image act as the drag handle
}
.padding()
.background(.background.secondary, in: .rect(cornerRadius: 8))
}
}
.padding()
}
}
License
ReorderingVStack is open source and available under the MIT License. See the LICENSE file for more details.
Related Skills
node-connect
349.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
