Post

Replies

Boosts

Views

Activity

Reply to How to break `while` loop and `deliver partial result to `View`?
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
Topic: Programming Languages SubTopic: Swift Tags:
Nov ’24
Reply to `import Collections` does make no sense errors.
OK. Collections was not added to my target.
Replies
Boosts
Views
Activity
Jan ’26
Reply to Most idiotic problem with assign value to value?
Bindings in superview was defined inside body.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’24
Reply to How to break `while` loop and `deliver partial result to `View`?
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
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Nov ’24
Reply to ImageRenderer rounds points coordinates to integer values
Instead of using GeometryReader and SwiftUI structs for dot shape, I used Canvas and draw paths into its context
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’24
Reply to ImageRenderer rounds points coordinates to integer values
Those circles are defined in brown noise random positions and sizes, but generated PDF has visible grid, many circles are became elipses. Smallest circle in picture has size 1pt x 1pt.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’24
Reply to Is it possible to generate nice PDF with gradient from SwiftUI view ?
I hope this is an ID: FB15716546
Topic: UI Frameworks SubTopic: General Tags:
Replies
Boosts
Views
Activity
Nov ’24