简体   繁体   中英

setExposureModeCustom crahes in iPhone X swift 4

I have an app, which will access Camera's Exposure mode settings for changing the Shutter Speed of the Camera with Custom values. And it's works as expected in maximum devices, except iPhone X. Below is the code which i am using,

do {
    try captureDevice.lockForConfiguration()
    captureDevice.setExposureModeCustom(duration: CMTimeMake(1,30), iso: 120, completionHandler: { (time) in
})
    captureDevice.unlockForConfiguration()
} catch {
    debugPrint(error)
}

It's crashes in above line and crash log says to check whether isExposureModeSupported .

崩溃日志截图 .

What is my problem is, we can check isExposureModeSupported , but if is all the iPhone X device doesn't support Custom Exposure mode? if so how can we make to support Custom Exposure Mode in iPhone X?

Or Do we need to change anything in the Camera Settings?

Can anyone please help in this?

iPhone x does support custom exposure, but when the builtInDualCamera device is selected all the custom settings are disabled. You just need to use another device, builtInWideAngleCamera or builtInTelephotoCamera .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM