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