Created
October 24, 2020 16:49
-
-
Save kmkrn/bd888e338739a96784ec2e3c13cf7b41 to your computer and use it in GitHub Desktop.
Drawing a triangle with Path
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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