I created a UIButton instance named \"button\" with an image using [UIButton setImage:forState:]. The button.frame is larger than the image\'s size.
[UIButton setImage:forState:]
Now
You must define specific property in Runtime Attributes of Identity inspector – imageView.contentModel, where you set value relatively to rawValue position of enum UIViewContentMode. 1 means scaleAspectFit.
imageView.contentModel
rawValue
UIViewContentMode
And button's alignment, in Attributes inspector: