How to make a button draggable/movable with SwiftUI?
问题 I am trying to make a Button Movable with SwiftUI. From what it looks like this should work. I have tried putting the Button with Text inside another ZStack and for a second it was working but as soon as I released the button, the dragging stopped and I couldn't drag anymore. I noticed that the tap was remaining in the center despite the button had moved. Also the dragging looked buggy. struct CircleButton: View { @State private var dragAmount = CGSize.zero var body: some View { ZStack {