I have an image view, declared programmatically, and I am setting its image, also programmatically.
However, I find myself unable to set the image to both fit the as
yourImageView.contentMode = .center
You can use the following options to position your image:
scaleToFillscaleAspectFit // contents scaled to fit with fixed
aspect. remainder is transparentredraw // redraw on bounds change (calls -setNeedsDisplay)center // contents remain same size. positioned adjusted.topbottomleftrighttopLefttopRightbottomLeftbottomRight