I have a UIImageView
where I have set the frame size to x = 0, y = 0, width = 404, height = 712
.
In my project, I need to change the image in
Use this for your UIImageView
imageView.contentMode = UIViewContentModeScaleAspectFill;
You won't get any space and with scale preserved. However, some part of the image will be clipped off.
If you use the following:
imageView.contentMode = UIViewContentModeScaleAspectFit;
There will be some empty space, but scale is preserved.