When i draw a bezierPath in swift on UIView. I get straight line along with it. I only need the curved line is it possible to remove the straight line.
I can remove gray fill by: line.fillColor = UIColor.clear.cgColor
Not sure how i can remove the straight line
Code:
let line = CAShapeLayer()
let linePath = UIBezierPath()
linePath.move(to: start)
linePath.addLine(to: end)
var dis = (end.x - start.x)/3.0
linePath.addCurve(to: start,
controlPoint1: CGPoint(x: start.x + dis, y: start.y + dis),
controlPoint2: CGPoint(x: end.x - dis, y: end.y - dis))
line.path = linePath.cgPath
line.strokeColor = UIColor.red.cgColor
//line.fillColor = UIColor.clear.cgColor
line.lineWidth = 4.0
line.opacity = 0.6
self.view.layer.addSublayer(line)
