I'm trying to draw an arrow like the one below but haven't finished it yet. Hope you can help me
My code
struct ContentView: View {
@State private var change = false
private let arrowWidth: CGFloat = 128
var body: some View {
Path { path in
path.move(to: .zero)
path.addLine(to: CGPoint(x: arrowWidth/2, y: -20))
path.move(to: CGPoint(x: arrowWidth/2, y: -20))
path.addLine(to: CGPoint(x: arrowWidth, y: 0))
}
.stroke(style: StrokeStyle(lineWidth: 1, lineCap: .round))
.frame(width: arrowWidth)
.foregroundColor(.green)
.animation(.default)
.padding(.top, 300)
}
}

Follow this images to create your path, then fill it
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With