Skip to content

Instantly share code, notes, and snippets.

@alexnikol
Created June 16, 2020 13:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexnikol/14c63c3e62b58ce91b24c860d961bccc to your computer and use it in GitHub Desktop.
Save alexnikol/14c63c3e62b58ce91b24c860d961bccc to your computer and use it in GitHub Desktop.
UIBezierPath-Curve
//Path Part
let path = UIBezierPath()
path.move(to: CGPoint(x: 50, y: 200))
path.addCurve(to: CGPoint(x: 200, y: 200),
controlPoint1: CGPoint(x: 80, y: 300),
controlPoint2: CGPoint(x: 150, y: 0))
//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