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