Let me explain, what I am trying to achieve in short. In iOS app, trying to take the Photo, with certain amount of torch level for e.g. 0.7, as below.
myDevice?.setTorchModeOnWithLevel(0.7)
When we take photo, with this settings, I can see the torch light intensity. But sometimes, we are getting dull or bright photos (independent of external light conditions).
Hence to check the exact issue, we want to measure torch intensity, tried to use key value observer for torchLevel property of AVCaptureDevice, but this value seems to be unchanged.
Below is the sample code.
self.myDevice?.addObserver(self, forKeyPath: "torchLevel", options: .new, context: nil);
override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
if keyPath=="torchLevel"
{
print(myDevice.torchLevel)
}
}
So not sure, whether iPhone 7's torch having some issue, when accessing from swift API ?
Already checked this, but no answer.