Hello there! I would like to build a game in SwiftUI where you can move an object with your mouse (for example: a rectangle points your mouse, and it goes where your mouse goes).
How can I do it?
Move with pointer
You have to add a gesture (here DragGesture):
https://www.hackingwithswift.com/quick-start/swiftui/how-to-add-a-gesture-recognizer-to-a-view