Can I write like the code below on Storyboard?
let button = UIButton()
button.titleLabel.center = CGPoint(x:button.titleLabel.center.x, y:button.titleLabel.center.y + 30)
Look into UIEdgeInsets
and the UIButton property titleEdgeInsets
.
button.titleLabelInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 30)
Depending on your exact needs and code, this should do what you need. (FYI - there is a imageEdgeInsets
also.)