title: CAShapeLayer fill color will stay White
body: <p>I can clearly see my line, with the right stroke color, and the line is being drawn correctly, but no matter what, the fill color stay white.</p>
  
  <p>I have added this layer to another <code>UIView</code> subclass (custom view )</p>
  
  <pre><code>  let shapeLayer = CAShapeLayer()
      shapeLayer.frame=CGRect(x: 0, y: 0, width: (size?.width)!, height: size!.height)
      shapeLayer.path = path.cgPath //from my bezier path
      shapeLayer.fillColor = UIColor.red.cgColor
      shapeLayer.strokeColor = curveLineColor!.cgColor
      shapeLayer.lineWidth = 3.0
      shapeLayer.lineJoin = CAShapeLayerLineJoin.round
      shapeLayer.lineCap = CAShapeLayerLineCap.round
      self.layer.addSublayer(shapeLayer)
  </code></pre>
  
  <p>What else can I try ?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>here is how I create the path :</p>
  
  <pre><code> let path = UIBezierPath()
   var point1:CGPoint!
   var point2:CGPoint!
   var firstpoint:CGPoint!
  
   for i in 0..&lt;curvePoints.count-1
   {
      point1 = curvePoints[i]
      point2 = curvePoints[i+1]
  
      point1.y=size!.height-point1.y
      point2.y=size!.height-point2.y
  
  
      path.move(to: point1)
      path.addLine(to: point2)
  
      if( i == 0 ) {firstpoint=point1}
  
  
  
   }
  
  //close the path
  path.move(to: point2)
  path.addLine(to: CGPoint(x: frame.width, y: frame.height))
  path.move(to: CGPoint(x: frame.width, y: frame.height))
  path.addLine(to: firstpoint)
  
  path.close()
  </code></pre>
  
  <p>Turns out if you don't close your line it will not color it, but my line describes a time series and my look like this :</p>
  
  <p><a href="https://i.stack.imgur.com/DtfLp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DtfLp.png" alt="enter image description here"></a></p>
  
  <p>As you can see I close the curve from the bottom, <strong>but</strong>, because of those triangle are open I can not put color under this line. It works only if I put a line that close all those triangles.</p>
  
  <p>Any suggestions to get a simple time series line filled with a color ?</p>