There are plenty of threads about aligning a button image according to the title text, but I can\'t find anything about just aligning the image to the right side of the butt
Storyboard:
Attributes Tab > Ensure your Content Edge tab is selected for 'image':
Then you alter the 'Left' property not right, which is what your doing programatically. So in other words, your padding it n from the left
UIEdgeInsetsMake = TOP | LEFT | BOTTOM | RIGHT
Programmatically :
button.imageEdgeInsets = UIEdgeInsetsMake(0, 100, 0, 0);
Note: you might have to also alter your titles inset, depending on where it is in reference to your image
Just like this:
btn.imageView?.translatesAutoresizingMaskIntoConstraints = false
btn.imageView?.centerYAnchor.constraint(equalTo: btn.centerYAnchor, constant: 0.0).isActive = true
btn.imageView?.trailingAnchor.constraint(equalTo: btn.trailingAnchor, constant: 0.0).isActive = true
btn.imageView?.contentMode = .right