How do I use CAShapeLayer to draw a line that has both a border color, border width and fill color?
Here’s what I’ve tried, but it’s only ever blue…
self.lineShape.strokeColor = [UIColor blueColor].CGColor;
self.lineShape.fillColor = [UIColor greenColor].CGColor;
self.lineShape.lineWidth = 100;
self.lineShape.lineCap = kCALineCapRound;
self.lineShape.lineJoin = kCALineJoinRound;
UIBezierPath* path = [UIBezierPath bezierPath];
[path moveToPoint:self.lineStart];
[path addLineToPoint:self.lineEnd];
self.lineShape.path = path.CGPath;
Swift 3+ extension method (combined from AechoLiu answer below):
Objective-C:
Also calling out @FarrasDoko comment to try changing
borderWidthtolineWidthandborderColortostrokeColor.