I am working on a small project where I want to draw a Bezier curve. I want to be able to change lineWidth
in different parts of the drawing.
Here is what I have:
CAShapeLayer *pathLayer = [CAShapeLayer layer]; pathLayer.frame = self.animationLayer.bounds; pathLayer.bounds = pathRect; pathLayer.geometryFlipped = YES; pathLayer.path = path.CGPath; pathLayer.strokeColor = [[UIColor blackColor] CGColor]; pathLayer.fillColor = nil; pathLayer.lineWidth = 1.0f; pathLayer.lineJoin = kCALineJoinBevel;
How can I change the line width? One solution might be to have multiple UIBezierPath
with multiple CAShapeLayer
s, but there should seem to be a simpler, more elegant solution (something like lineWidth
lines at the level where the UIBezierPath
lines UIBezierPath
indicated).
Thanks!
source share