I've created an imagePickerController
which I am trying to create a custom overlayView for. I have done this, but when hiding the camera controls, I was left with a big black space.
So I tried to fill this by attempting to dynamically scale my camera to fit the screen, no matter what device is used. The result is that on my iphone 6, the camera does now fill the screen but it is super zoomed in and I don't know how to counteract this. Help much appreciated. This is my code:
let screenBound = UIScreen.mainScreen().bounds.size
let cameraAR = 4.0/3.0 as CGFloat
let cameraVH = screenBound.width * cameraAR
let scale = screenBound.height / cameraAR
imagePicker.cameraViewTransform = CGAffineTransformMakeTranslation(0, screenBound.height - cameraVH / 2.0)
imagePicker.cameraViewTransform = CGAffineTransformScale(imagePicker.cameraViewTransform, scale, scale)