Last active
March 25, 2020 11:55
-
-
Save alladinian/8908832d960703561c59664cffbb8437 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 CurveShape: Shape { | |
let cp0, cp1: RelativePoint | |
func path(in rect: CGRect) -> Path { | |
Path { p in | |
p.move(to: CGPoint(x: 0, y: rect.size.height)) | |
p.addCurve(to: CGPoint(x: rect.size.width, y: 0), | |
control1: cp0 * rect.size, | |
control2: cp1 * rect.size) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment