I am trying to draw a cursor and I've used UIBezierPath to do so.
Here is what I did :
drawing line from the top pointer to the right edge.
drawing line from the top pointer to the left edge.
setting the bezierPath to a layer with width.
here is the code:
cursorLayerPathPointTop = UIBezierPath()
cursorLayerPathPointTop.lineJoinStyle = CGLineJoin.Round
cursorLayerPathPointTop.lineCapStyle = CGLineCap.Round
cursorLayerPathPointTop.lineWidth = 20
cursorLayerPathPointTop.moveToPoint(cursor_point_top)
cursorLayerPathPointTop.addLineToPoint(cursorRightPoint)
cursorLayerPathPointTop.moveToPoint(cursor_point_top)
cursorLayerPathPointTop.addLineToPoint(cursorLeftPoint)
//adding calyer
cursorLayer = CAShapeLayer()
cursorLayer.lineWidth = 3.0;
cursorLayer.path = cursorLayerPathPointTop.CGPath
cursorLayer.strokeColor = UIColor.whiteColor().CGColor
self.layer.addSublayer(cursorLayer)
I need to make the cursor thick , so that the reason for setting cursorLayer.lineWidth = 3.0;
.
but here is what i got:
As you can see the pointer the lines is not joined together smoothly. What should I do to fix that ?