I am having this error on PostiOS10PhotoCapture.swift
if let deviceInput = deviceInput {
if deviceInput.device.isFlashAvailable {
switch currentFlashMode {
case .auto:
if photoOutput.supportedFlashModes.contains(.auto) {
settings.flashMode = .auto
}
case .off:
if photoOutput.supportedFlashModes.contains(.off) {
settings.flashMode = .off
}
case .on:
if photoOutput.supportedFlashModes.contains(.on) {
settings.flashMode = .on
}
}
}
}
Any idea?
I think this is xcode 12 beta 6 bug.
How to fix this ? any idea ?
I'm having the same issue with Xcode 12 beta 6...
wait for next release of xcode 12,馃槄
same error on Xcode 12.0 GM (Simulator)
working on device
I think can use this code.
// Set flash mode.
if let deviceInput = deviceInput, let supportedFlashModes = photoOutput.value(forKey: "supportedFlashModes") as? [Int] {
if deviceInput.device.isFlashAvailable {
switch currentFlashMode {
case .auto:
if supportedFlashModes.contains(AVCaptureDevice.FlashMode.auto.rawValue) {
settings.flashMode = .auto
}
case .off:
if supportedFlashModes.contains(AVCaptureDevice.FlashMode.off.rawValue) {
settings.flashMode = .off
}
case .on:
if supportedFlashModes.contains(AVCaptureDevice.FlashMode.on.rawValue) {
settings.flashMode = .on
}
}
}
}
you can see the pull request at : https://github.com/Yummypets/YPImagePicker/pull/565
this is confirmed still broken in xcode 12 official release
I was able to fix this temporarily by deleting this code, which my project doesn't need anyway :)
if let deviceInput = deviceInput {
if deviceInput.device.isFlashAvailable {
switch currentFlashMode {
case .auto:
if photoOutput.supportedFlashModes.contains(.auto) {
settings.flashMode = .auto
}
case .off:
if photoOutput.supportedFlashModes.contains(.off) {
settings.flashMode = .off
}
case .on:
if photoOutputsupportedFlashModes.contains(.on) {
settings.flashMode = .on
}
}
}
}
@NikKovIos Hi, any chance of having a new release which can be used with latest Xcode 12?
We've created a fork which comments out this section of code and so allows building with Xcode 12 gm here: https://github.com/bikemap/YPImagePicker - feel free use this fork as a workaround until the issue is resolved here.
Most helpful comment
I think can use this code.
you can see the pull request at : https://github.com/Yummypets/YPImagePicker/pull/565