In IOS 15, Even after setting button text alignment to right, it leaves little space after the button title text. As shown in the following image it leaves the space after the word Test. How can I remove this space? I want the letter "t" in the text to touch the trailing of the button.
In ios 14 and below it looks like this
This is a little trick or you can do it with UIButton.Configuration, set your button like this:
This is UIButton.Configuration style:
in viewDidLoad present button and set constraints:
This is the result: