I have a UIButton that I want to resize to fit whatever text is inside it. It has a set width of 280, but the text should wrap to the next line(s) and extend the height of the button as needed.
I’ve set line breaks to Word Wrap and tried sizeToFit but that only makes the button go wider, not vertical.
I managed to get it working in a category of UIButton:
If anyone uses this make sure to set: