I have the following layout, and I\'m trying to add a padding to the left and right..
The controls are a disabled UIButton.
This option is also viable if its not too annoying to use a UIButton subclass
class Button: UIButton {
override var intrinsicContentSize: CGSize {
get {
let baseSize = super.intrinsicContentSize
return CGSize(width: baseSize.width + titleEdgeInsets.left + titleEdgeInsets.right,
height: baseSize.height + titleEdgeInsets.top + titleEdgeInsets.bottom)
}
}
}
Then use titleEdgeInsets
as desired
let button = Button()
... configure button
button.titleEdgeInsets = ...