Why can't we fit the height of the text in single line labels?
In the README, there is this sentence:
Make the text fit the label size: width and height if multilines, width only if single lines
Why do we only fit width in single line labels?
In case of single line, height is dynamically adapted following the label font size. So if it fits width, the height will follow. I never encounter a case where the height was the constraint, so never though about making work in this case.
Beside that, I'm ok to add this feature if you need it.
I have labels where the text is shorter than the label's width. So when it tries the match the width, the text also grows taller and out of the bounds of the label. Can you add this feature?
That seems to be a bug, I don't think it's the right behaviour 🤔
This is actually a common use case. Anytime you have a really long label the bottom or top of the text is liable to be clipped off.
I fixed this for myself by changing line 97 in the UILabelExtension to this:
let state = multiLineSizeState(rect: rect, size: size)