I have a base view which displays a number of subviews at fixed positions. Its for laying out tables in a restaurant. The base view is an image of the restaurant floor, the subviews are images of tables. The user can click on a table and drag it about - so far so good, all working.
Tables should only be placed in certain places, for arguments sake we'll say every 100 pixels (x and y) in the base view.
While the user drags the table about smoothly, I'd like a "shadow" rectangle to snap to just the nearest available place that's allowable like it's saying "this is where the table will snap to when you drop it"
Can someone help this old dinosuar by explaining how to include a temporary rectangle in a SwiftUI view that updates it's position during the DragGesture of the table? Thank you!