title: Changing Color of UIBezierPath in Swift
body: <p>I was trying to change the color of a UIBezierPath so I copied some reliable code from the Internet, but I got an error which I can't seem to understand. Below is the code and the error. Please help. </p>
  
  <pre><code> override func draw(_ rect: CGRect) {
      let skullRadius = min(bounds.width, bounds.height)
      let skullCenter = CGPoint(x: bounds.midX, y: bounds.midY)
      let skull = UIBezierPath(arcCenter: skullCenter, radius: skullRadius, startAngle: 0.0, endAngle: CGFloat(2*M_PI), clockwise: false)
      skull.lineWidth = 3
      UIColor.blueColor().setFill()
      skull.stroke()
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/KD8AJ.png" rel="nofollow"><img src="https://i.stack.imgur.com/KD8AJ.png" alt="enter image description here"></a></p>