Skip to content

Instantly share code, notes, and snippets.

@alladinian
Last active March 25, 2020 11:55
Show Gist options
  • Save alladinian/8908832d960703561c59664cffbb8437 to your computer and use it in GitHub Desktop.
Save alladinian/8908832d960703561c59664cffbb8437 to your computer and use it in GitHub Desktop.
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