I have this code:
myButton.setBackgroundImage(UIImage(named: "image1"), for: .normal)
I'm trying to add a background for the button from the code level. I would like to set the aspect fit to this background. At the moment, the background image is not displayed properly.