When I'm running the app in iPhone 6S with iOS 11.2.2. The Flash is not working. Toggle button is working fine i.e., On/Off. But, Flash is not coming when the toggle is On.
- (void)toggleFlash{
NSArray *devices = [AVCaptureDevice devices];
for (AVCaptureDevice *device in devices){
if (device.flashAvailable) {
if (flashOn){
[device lockForConfiguration:nil];
[device isTorchModeSupported:AVCaptureTorchModeOn];
[device unlockForConfiguration];
}
else{
[device lockForConfiguration:nil];
[device isTorchModeSupported:AVCaptureTorchModeOff];
[device unlockForConfiguration];
}
}
}
}
Done with the debugging.. It's working fine. But, Issue with Flash. Anyone Working on this issue. Please help me out?