1

Is it possible to re-order buttons inside a Hstack? i want to be able to click and drag any of the buttons from right to left, vice versa but not sure how to do it. This is for a macOS app.

enter image description here

struct ContentView: View {
    var body: some View {
        HStack {
            Button("1") {
                
            }
            .padding()
            
            
            Button("2") {
            }
            .padding()
            
            
            Button("3") {
            }
            .padding()
            
            
    
            
        }
        .padding()
    }
}
swiftnoob
  • 303
  • 1
  • 5
  • 21
  • Maybe you can do that with DragGesture: https://developer.apple.com/documentation/swiftui/draggesture – koen May 26 '23 at 08:09

0 Answers0