|
nodes.n_array[index].x and nodes.n_array[index].y are not updating. Circles stay at starting points even when dragging.
Class with array of nodes:
|
|
You This is an issue because changing the value of a property of a class object doesn't change the object, so SwiftUI can't observe the change. Changing a value type creates a whole new item and destroys the old one, so SwiftUI sees the change and can update the You should rework your code so that |
|
Here's how I changed your code to make it work. Note that since I didn't have your
|
|
SPONSORED Still waiting on your CI build? Speed it up ~3x with Blaze - change one line, pay less, keep your existing GitHub workflows. First 25 HWS readers to use code HACKING at checkout get 50% off the first year. Try it now for free!
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.