Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import SwiftUI
struct ContentView: View {
var body: some View {
Canvas { context,size in
for _ in 0..<80 {
let x = CGFloat.random(in:0...size.width)
let y = CGFloat.random(in:0...size.height)
var p = Path()
p.move(to:CGPoint(x:x,y:y))
p.addLine(to:CGPoint(x:x+8,y:y+4))
p.addLine(to:CGPoint(x:x,y:y+8))
p.closeSubpath()
context.fill(p,with:.color(.blue))
}
}
}
}Coding works best on desktop or with an external keyboard.