Llg Llg - 8 months ago 66
Swift Question

Add padding between label and its border

I have in my swift application some labels that should have border. I added border to my label but I want to have more spaces between the label and its border.

How can I do that?


Try this:

myLabel.frame.size.width = myLabel.intrinsicContentSize.width + 10
myLabel.frame.size.height = myLabel.intrinsicContentSize.height + 10
myLabel.textAlignment = .center