I have a button in a tableViewCell but I cannot shrink it to fit its titleLabel, which is smaller than the button is. The button seems to have a minimum frame. When I deleted all its constraints within the cell, I could change its size again. But how do I supposed to shrink it while having these constraints?

The button - "subjectButton" - in the cell

[![enter image description here](https://i.stack.imgur.com/tltla.png)](https://i.stack.imgur.com/tltla.png)

Constrains of "subjectButton":

[![enter image description here](https://i.stack.imgur.com/XY589.png)](https://i.stack.imgur.com/XY589.png)

My attempt:

```
func setButtonStyle(_ button: UIButton, subject: String) {
    button.backgroundColor = UIColor.lightGray
    button.setTitle(subject, for: .normal)
    button.setTitleColor(UIColor.white, for: .normal)
    button.layer.cornerRadius = 3
    button.titleLabel?.sizeToFit()
    button.sizeToFit()
    button.frame.size = CGSize(width: 5, height: 20)
}

```

Simulator (with "Colored Blended Layers" turned on):

[![enter image description here](https://i.stack.imgur.com/SWkQ7.png)](https://i.stack.imgur.com/SWkQ7.png)

As you can see, the button does not shrink to fit its titleLabel by using `button.sizeToFit`. Also, I failed to manually resize it by using `button.frame.size = CGSize(width: 5, height: 20)`. 

Why? Thanks in advance.