Swift UiButton how to left align the title?

swift, uibutton

Solution

Try this one

button.contentHorizontalAlignment = .left

Problem

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 ```

Original source

Related problems