Last active
June 16, 2020 13:08
-
-
Save alexnikol/ddbd323f96d5cf512812928c27187e47 to your computer and use it in GitHub Desktop.
UIBezierPath-QuadCurve
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
//Path part | |
let path = UIBezierPath() | |
path.move(to: CGPoint(x: 50, y: 50)) | |
path.addQuadCurve(to: CGPoint(x: 200, y: 50), | |
controlPoint: CGPoint(x: 100, y: 200)) | |
//Shape part | |
let shape = CAShapeLayer() | |
shape.path = path.cgPath | |
shape.lineWidth = 4.0 | |
shape.fillColor = UIColor.clear.cgColor | |
shape.strokeColor = UIColor.orange.cgColor | |
view.layer.addSublayer(shape) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment