title: iOS UIProgressView with gradient
body: <p>is it possible to create a custom ui progress view with a gradient from left to right?</p>
  
  <p>I've tried it with the following code:</p>
  
  <pre><code>    let gradientLayer = CAGradientLayer()
      gradientLayer.frame = self.frame
  
      gradientLayer.anchorPoint = CGPoint(x: 0, y: 0)
      gradientLayer.position = CGPoint(x: 0, y: 0)
  
      gradientLayer.startPoint = CGPoint(x: 0.0, y: 0.0);
      gradientLayer.endPoint = CGPoint(x: 1.0, y: 0.0);
  
      gradientLayer.colors = [
          UIColor.red,
          UIColor.green
      ]
  
      // Convert to UIImage
      self.layer.insertSublayer(gradientLayer, at: 0)
      self.progressTintColor = UIColor.clear
      self.trackTintColor = UIColor.black
  </code></pre>
  
  <p>But unfortunately the gradient is not visible. Any other ideas? </p>