title: UIProgressView with rounded progress track edge - Swift 3
body: <p>I have a UIProgressView and want to have a corner radius for the filled part (progress part) , I am able to make the corners of the progress view rounded using the cornerRadius property , I also want to the filled progress edge to be rounded.Please find below how the progress bar looks now.</p>
  
  <p><a href="https://i.stack.imgur.com/rtUPT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rtUPT.png" alt="enter image description here"></a></p>
  
  <p>I want the edge of the red portion to be rounded.</p>
  
  <p>I tried to set the progressImage with an image having rounded edges , while it solves the issue , the image itself is far stretched , the radii in the corners are not maintained.</p>
  
  <p>The other thing I tried was to draw a rectangle and fill it with the progress color and convert it to a UIImage with the following code and set it as progress Image , in this case , the image is always black , not sure what I am missing.
  Please find below the code for converting uiview to uiimage </p>
  
  <pre><code>class func imageWithView(view: UIView) -&gt; UIImage {
      UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.isOpaque, 0.0)
      view.drawHierarchy(in: view.bounds, afterScreenUpdates: true)
      let img = UIGraphicsGetImageFromCurrentImageContext()
      UIGraphicsEndImageContext()
      return img!
  }
  </code></pre>