I have a single-line UILabel with the following configuration:
let label = UILabel()
label.text = "Lorem ipsum dolor sit amet"
label.numberOfLines = 1
When I call sizeThatFits(size) on this label with a small size width, the result is always a size with a bigger width.
let labelSize = label.sizeThatFits(CGSize(width: 30, height: UILabel.noIntrinsicMetric))
// labelSize.width > 30
Shouldn’t sizeThatFits() returns a size that is smaller or equal than the fitting size? Not sure what am I missing.