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
UIImageView
x = 0, y = 0, width = 404, height = 712
You can use
self.imageView.contentMode = UIViewContentModeScaleAspectFit;
Swift 3:
imageView.contentMode = .scaleAspectFit
Or UIViewContentModeCenter / .center, or any of the other modes described in the UIView documentation.
UIViewContentModeCenter
.center