I have a UIButton created programmatically but can't find a way to left align the title.
This does nothing:
button.setTitle("DESCRIPTION", for: .normal)
button.titleLabel?.textAlignment = .left
I have a UIButton created programmatically but can't find a way to left align the title.
This does nothing:
button.setTitle("DESCRIPTION", for: .normal)
button.titleLabel?.textAlignment = .left
For left side aligment:
buttonItem.contentHorizontalAlignment = .left
For right side aligment:
buttonLogout.contentHorizontalAlignment = .right
and bydefault alignment for button title is center.