For iOS7, I used the UIButton
titleLabel.frame.size.width
property to determine the width of my button title under different localisations so I could p
If you are then setting an image next to a button after getting the frame, you can use
[theButton setTitle: @"theTitle" forState:UIControlStateNormal];
[theButton setImage: theImage forState:UIControlStateNormal];
[theButton setNeedsLayout];
[theButton layoutIfNeeded];
[theButton setImageEdgeInsets: UIEdgeInsetsMake(6, transactionsButton.titleLabel.frame.size.width + 40.0, 0, 0)];
And in Swift 3, this will do.
self.view.layoutIfNeeded()