I have a UIButton
with text \"Explore the app\" and UIImage
(>)
In Interface Builder
it looks like:
[ (>) Explore t
Another simple way (that is NOT iOS 9 only) is to subclass UIButton to override these two methods
override func titleRectForContentRect(contentRect: CGRect) -> CGRect {
var rect = super.titleRectForContentRect(contentRect)
rect.origin.x = 0
return rect
}
override func imageRectForContentRect(contentRect: CGRect) -> CGRect {
var rect = super.imageRectForContentRect(contentRect)
rect.origin.x = CGRectGetMaxX(contentRect) - CGRectGetWidth(rect)
return rect
}
contentEdgeInsets
is already taken into account by using super.