title: How to add corner radius to a UIBezier Path Arc
body: <p>I am creating an arc using UIBezierPath arc convenience method. I want the ends of the arc to be rounded off - see attached sketch for exact requirement! The cornerRadius option used in the roundedRect version isn't available for the arc method. Anyone got an ideas on how to achieve this? Thanks in advance. (This is different to previously asked question in that it provides exact requirement)</p>
  
  <pre><code> let center = CGPoint(x:bounds.width/2, y: bounds.height/2)
   let radius: CGFloat = max(bounds.width, bounds.height)
   let arcWidth: CGFloat = 10
   let startAngle: CGFloat = 4.6 / 3 * π
   let endAngle: CGFloat = 4.4 / 3 * π
  
   let path = UIBezierPath(arcCenter: center, radius: radius/2 - arcWidth/2, startAngle: startAngle, endAngle: endAngle, clockwise: true)
  
   path.lineWidth = arcWidth
   // all thats needed to make the ends rounded is
   path.lineCapStyle = .Round
   path.stroke()
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/pRPMU.png" rel="noreferrer"><img src="https://i.stack.imgur.com/pRPMU.png" alt="enter image description here"></a></p>