Get UIButtons size strictly based on its text and font

suggest change

To get the the exact size of a UIButton’s text based on its font, use the function intrinsicContentSize.

Swift

button.intrinsicContentSize.width

Objective-C

button.intrinsicContentSize.width;

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents