we are writing an app for iPhones and laying out some graphics, and at one point we are showing a photo. We size it to the screen by using these parameters (in our view controller).
let view_width : CGFloat = self.view.bounds.width
let view_height : CGFloat = self.view.bounds.height
On the targets we have used so far, this works fine on an iPhone 7 and iPhone 8. However we just tried it on an iPhone 12 Pro and the image looks stretched, the aspect ratio is off and it is partially off the screen.
Are there parameters we should use other than the above to ensure that we are laying things out according to the screen dimensions, that will work on every phone?
Thanks.