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()
}