Get UIButtons size strictly based on its text and font
suggest changeintrinsicContentSize is the button’s layout size for its current title, image, font, and insets. It is not the text measurement alone. The lines below read only the width.
Swift
button.intrinsicContentSize.width
Objective-C
button.intrinsicContentSize.width;
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents