I am facing issue while turning on torch in iOS 12. It is working fine till iOS 11 but not in iOS 12.
Torch is not turning on. I am using the below code.
if device.hasTorch && device.isTorchModeSupported(torchMode) {
do {
try device.lockForConfiguration()
device.torchMode = torchMode
device.unlockForConfiguration()
}
catch let error as NSError {
print(error)
Utils.showAlertWithTitleInController("No Torch Error", message: error.debugDescription, controller: self)
}
}