I tried to create a function inside a custom UIButton class to add a shape to an existing button. 

```
func drawStartButton(){
    let shape = CAShapeLayer()
    let path = UIBezierPath()
    path.move(to: CGPoint(x: 0, y: 0))
    path.addLine(to: CGPoint(x: 500, y: 0))
    path.addLine(to: CGPoint(x: 500, y: -100))
    path.addLine(to: CGPoint(x: 250, y: -50))
    path.addLine(to: CGPoint(x: 0, y: -100))
    path.addLine(to: CGPoint(x: 0, y: 0))
    path.close()

    shape.path = path.cgPath
    shape.fillColor = redColor.cgColor
    shape.frame = self.bounds
    self.layer.addSublayer(shape)

}

```

So far no problem... BUT when i add the layer to the button, the layer is to big of course! How can i "autoresize" the layer to its button? I did expect something like 

`shape.frame = self.bounds` 
... but the path still keeps the same size as without the self.bounds.