Can we control optical zoom value manually for iOS camera?

98 Views Asked by At

I want to add an optical zoom level to the custom value for the ios camera, Can we achieve this for all iPhone devices depending on their camera type? I have tried this but I am not sure about this is correct or not.

if let device = AVCaptureDevice.default(for: AVMediaType.video {
 try! device.lockForConfiguration()
 device.videoZoomFactor = 1.0
 device.unlockForConfiguration()                               
 }
0

There are 0 best solutions below