Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import SwiftUI
struct ContentView: View {
var body: some View {
Canvas { context,size in
for x in stride(from:40.0,to:size.width,by:60){
for y in stride(from:40.0,to:size.height,by:60){
var p=Path()
p.move(to:CGPoint(x:x,y:y-20))
p.addLine(to:CGPoint(x:x+20,y:y))
p.addLine(to:CGPoint(x:x,y:y+20))
p.addLine(to:CGPoint(x:x-20,y:y))
p.closeSubpath()
context.stroke(p,with:.color(.brown))
}
}
}
}
}Coding works best on desktop or with an external keyboard.