For now like this, in a simplest way
struct ContentView: View {
@ObservedObject var manager = Manager()
var body: some View {
...
VStack {
ScrollView([.horizontal, .vertical]) {
DotTestView(dots: $manager.dots)
.frame(width: manager.size.width,
height: manager.size.height)
}
HStack {
Button(action: {
Task {
await manager.updateDots(in: manager.size)
}},
label: {Text("start")})
Button(action: {
print ("stop")},
label: {Text("How to Stop")})
}
}
...
}
}
Manager keeps all configuration data, has @Published var dots:[Dot]. Simple as that.
And a problem is that Rainbow Wheel does not allow me to touch any Button. I suspect:
@MainActor
public struct DotGenerator {....}
but I don't know how to make it different way in Swift6