Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import SwiftUI
struct ContentView: View {
var body: some View {
Canvas { context,size in
let c = CGPoint(x:size.width/2,y:size.height/2)
for i in 0..<200 {
let a = Double(i)*.pi/100
let r = CGFloat.random(in:40...150)
let x = c.x + cos(a)*r
let y = c.y + sin(a)*r
context.fill(Path(ellipseIn:CGRect(x:x,y:y,width:4,height:4)),with:.color(.red))
}
}
}
}Coding works best on desktop or with an external keyboard.