Ad

Show A Second ImageView On UIButton

- 1 answer

I want to add an extra image on the UIButton if my condition is true. This means that if the result of my condition is:

1) "false", then the UIButton should contain one image.

2) "true", then the UIButton should contain one more additional image.

Ad

Answer

If you want to add 2 images, add them under your button.

In order to stretch the first image, set constraint of the width of the second image = 0 and set constraint of the space between the images = 0.

enter image description here

Ad
source: stackoverflow.com
Ad