Now I want to alignment the text of button to the left with code , how to do ? and I code this :
button.titleLabel.textAlignment = UITextAlignmentLeft;
For those who are using Swift 3
button.contentHorizontalAlignment = .left
Above code align text to left border, so you might want little padding.
button.contentEdgeInsets = UIEdgeInsetsMake(0, 10, 0, 0)