Is it possible to get the camera zoom level on various device models in iPhone like in builtin camera programmatically example 0.5x, 1x, 2x buttons etc?
Camera zoom level
Do you want to set the zoom or to know what is the zoom ?
You may find this thread interesting: https://stackoverflow.com/questions/64832734/how-to-set-back-camera-zoom-level-to-0-5x-using-swift
Hello,
I believe what you are wondering is how you can identify all of the native video zoom factors (i.e. the zoom factors that do not perform upscaling).
To identify all of these zoom factors, you can use a combination of the virtualDeviceSwitchOverVideoZoomFactors and the secondaryNativeResolutionZoomFactors properties.
For example, consider the builtInTripleCamera of an iPhone 14 Pro:
print(device.minAvailableVideoZoomFactor) // 1.0, this uses the ultra-wide angle lens without upscaling, i.e. "0.5x".
print(device.virtualDeviceSwitchOverVideoZoomFactors) // [2, 6] At 2, this uses the wide angle lens without upscaling. At 6, this uses the telephoto lens without upscaling, i.e. "1x" and "3x".
print(device.activeFormat.secondaryNativeResolutionZoomFactors) // [4.0] at 4.0, this uses the wide angle lens and does a crop of the 48 MP sensor to achieve a "zoom" without upscaling, i.e. "2x".