Created
February 9, 2020 10:29
-
-
Save DaisukeNagata/939345223ae6e2e149ddf97093ac4c90 to your computer and use it in GitHub Desktop.
SwiftUI_Graph
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
import SwiftUI | |
struct ContentView: View { | |
var body: some View { | |
Path { path in | |
path.move(to: CGPoint(x: 45, y: 250)) | |
path.addArc(center: CGPoint(x: 50,y: 250), radius: 5, startAngle: Angle(degrees: 0), endAngle: Angle(degrees: 360),clockwise: false) | |
path.addLine(to: CGPoint(x: 100, y: 200)) | |
path.addArc(center: CGPoint(x: 100,y: 200), radius: 5, startAngle: Angle(degrees: 0), endAngle: Angle(degrees: 360),clockwise: false) | |
path.addLine(to: CGPoint(x: 150, y: 143)) | |
path.addArc(center: CGPoint(x: 150,y: 143), radius: 5, startAngle: Angle(degrees: 0), endAngle: Angle(degrees: 360),clockwise: false) | |
path.addLine(to: CGPoint(x: 200, y: 150)) | |
path.addArc(center: CGPoint(x: 200,y: 150), radius: 5, startAngle: Angle(degrees: 0), endAngle: Angle(degrees: 360),clockwise: false) | |
path.addLine(to: CGPoint(x: 250, y: 120)) | |
path.addArc(center: CGPoint(x: 250,y: 120), radius: 5, startAngle: Angle(degrees: 0), endAngle: Angle(degrees: 360),clockwise: false) | |
path.addLine(to: CGPoint(x: 300, y: 124)) | |
path.addArc(center: CGPoint(x: 300,y: 124), radius: 5, startAngle: Angle(degrees: 0), endAngle: Angle(degrees: 360),clockwise: false) | |
path.addLine(to: CGPoint(x: 350, y: 65)) | |
path.addArc(center: CGPoint(x: 350,y: 65), radius: 5, startAngle: Angle(degrees: 0), endAngle: Angle(degrees: 360),clockwise: false) | |
} | |
.stroke(Color.blue, lineWidth: 5) | |
} | |
} | |
struct ContentView_Previews: PreviewProvider { | |
static var previews: some View { | |
ContentView() | |
} | |
} |
Author
DaisukeNagata
commented
Feb 9, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment