SyntaxFix
Write A Post
Hire A Developer
Questions
sizeToFit doesn't work correctly. instead:
myButton.size = myButton.sizeThatFits(CGSize.zero)
you also can add contentInset to the button:
contentInset
myButton.contentEdgeInsets = UIEdgeInsetsMake(8, 8, 4, 8)