How to change UIBezierPath background color?
Try this:
let radius: CGFloat = 50
let path: UIBezierPath = UIBezierPath(roundedRect: CGRect(x: 0, y: 0, width: 50, height: 50), cornerRadius: 0)
let circlePath: UIBezierPath = UIBezierPath(roundedRect: CGRect(x: 0, y: 0, width: radius, height: radius), cornerRadius: radius)
path.append(circlePath)
let fillLayer = CAShapeLayer()
fillLayer.path = path.cgPath
fillLayer.fillColor = UIColor.red.cgColor
yourView.layer.addSublayer(fillLayer)
Paths do not have color; layers have color.
You need to create a layer based on a path, and add it to the layer of your view as shown in the code above.