Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import SwiftUI
struct ContentView: View {
let nums=[20,20,40,60,100,160,260]
var body: some View {
Canvas { context,size in
var x:CGFloat=150
var y:CGFloat=150
for n in nums{
let rect=CGRect(x:x,y:y,width:CGFloat(n),height:CGFloat(n))
context.stroke(Path(ellipseIn:rect),with:.color(.orange))
x+=10;y+=10
}
}
}
}Coding works best on desktop or with an external keyboard.