To get the the exact size of a UIButton's text based on its font, use the function intrinsicContentSize.
intrinsicContentSize
Swift
button.intrinsicContentSize.width
Objective-C
button.intrinsicContentSize.width;