Skip to content

Instantly share code, notes, and snippets.

@kmkrn
Created October 24, 2020 16:49
Show Gist options
  • Save kmkrn/bd888e338739a96784ec2e3c13cf7b41 to your computer and use it in GitHub Desktop.
Save kmkrn/bd888e338739a96784ec2e3c13cf7b41 to your computer and use it in GitHub Desktop.
Drawing a triangle with Path
struct ContentView: View {
var body: some View {
Path { path in
path.move(to: CGPoint(x: 100, y: 100))
path.addLine(to: CGPoint(x: 100, y: 300))
path.addLine(to: CGPoint(x: 300, y: 300))
path.addLine(to: CGPoint(x: 100, y: 50))
}
.fill(Color.yellow)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment