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
I hope this can help to somebody else:
Swift 3+
button.contentHorizontalAlignment = UIControlContentHorizontalAlignment.fill button.contentVerticalAlignment = UIControlContentVerticalAlignment.fill