title: How to animate a fill color change on UIBezierPath?
body: <p>The shape is filled in correctly to begin with but I can't figure out how to change the fill color or, even better, how to animate a fill color change on a <code>UIBezierPath</code>. Just like changing the background color of a UIView is what I'm looking for.</p>
  
  <pre><code>var fillColor = UIColor()
  
  func changeBackgroundColor() {
  
      let animcolor = CABasicAnimation(keyPath: "fillColor")
      animcolor.fromValue = UIColor.greenColor()
      animcolor.toValue = UIColor.orangeColor()
      animcolor.duration = 1.0;
      animcolor.repeatCount = 0;
      animcolor.autoreverses = true
      shapeLayer.addAnimation(animcolor, forKey: "fillColor")
  
  }
  
  
  var fillColor = UIColor()
  let clipPath = UIBezierPath()
  let shapeLayer = CAShapeLayer()
  
  override func drawRect(rect: CGRect) {
  
          clipPath.moveToPoint(CGPointMake(self.bounds.minX + 7.65, self.bounds.minY - 0.25))
          clipPath.addCurveToPoint(CGPointMake(self.bounds.minX + 7.65, self.bounds.minY + 36.1), controlPoint1: CGPointMake(self.bounds.minX - 2.38, self.bounds.minY + 9.79), controlPoint2: CGPointMake(self.bounds.minX - 2.38, self.bounds.minY + 26.06))
          clipPath.addCurveToPoint(CGPointMake(self.bounds.minX + 43.99, self.bounds.minY + 36.1), controlPoint1: CGPointMake(self.bounds.minX + 17.69, self.bounds.minY + 46.13), controlPoint2: CGPointMake(self.bounds.minX + 33.96, self.bounds.minY + 46.13))
          clipPath.addLineToPoint(CGPointMake(self.bounds.minX + 43.99, self.bounds.minY + 36.1))
          clipPath.addLineToPoint(CGPointMake(self.bounds.minX + 44.01, self.bounds.minY + 0.19))
          clipPath.addLineToPoint(CGPointMake(self.bounds.minX + 7.58, self.bounds.minY + 0.19))
          clipPath.usesEvenOddFillRule = true
          fillColor = userColor
      }
  
  clipPath.addClip()
  fillColor.setFill()
  clipPath.fill()
  shapeLayer.path = clipPath.CGPath
  self.layer.mask = shapeLayer
  </code></pre>