Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import SwiftUI
struct ContentView: View {
let phi=1.618
var body: some View {
Canvas { context,size in
var w:CGFloat=40
var x:CGFloat=20
for _ in 0..<8{
let h=w*CGFloat(phi)
context.stroke(Path(CGRect(x:x,y:40,width:w,height:h)),with:.color(.green))
x+=w+10
w*=0.8
}
}
}
}Coding works best on desktop or with an external keyboard.