Your extensions are working fine. The problem may be in the code that adds the layer to the view (which you are not showing).
I would suggest that you simplify your project, for example, using a predefined array of points that definitely match your view. For example, for a view with a width of 500 pixels and a height of 300 pixels, you can use something like:
let points = [ CGPoint(x: 10, y: 10), CGPoint(x: 490, y: 10), CGPoint(x: 490, y: 290), CGPoint(x: 10, y: 290), CGPoint(x: 10, y: 10) ]
Use colors that are clearly visible, such as black and yellow for your stroke and fill.
Make sure your path is correctly added to the view, for example:
let path = UIBezierPath(points: points) let shapeLayer = CAShapeLayer(path: path, lineColor: UIColor.blue, fillColor: UIColor.lightGray) view.layer.addSublayer(shapeLayer)
Inspect the controller containing the view in Xcode Interface Builder. In the debug view hierarchy function:

source share