2

Has anyone been able to get the iPhone 5's new low light boost mode to work in their custom camera app? I tried the following code, but noticed no difference - whereas the native camera app significantly boosted the brightness.

if ([[captureManager backFacingCamera] isLowLightBoostEnabled]) {

    [[captureManager backFacingCamera] automaticallyEnablesLowLightBoostWhenAvailable];
}
Brad Larson
  • 170,088
  • 45
  • 397
  • 571
bmueller
  • 2,681
  • 1
  • 27
  • 45

1 Answers1

5

You need to lockForConfiguration, according to the docs (well, the header file):

if ([[self backFacingCamera] respondsToSelector:@selector(isLowLightBoostSupported)]) {
  if ([[self backFacingCamera] lockForConfiguration:nil]) {
    if ([self backFacingCamera].isLowLightBoostSupported)
      [self backFacingCamera].automaticallyEnablesLowLightBoostWhenAvailable = YES;
    [[self backFacingCamera] unlockForConfiguration];
  }
}

Also, isLowLightBoostEnabled tells you whether or not the low light is actually being boosted, not whether it can be. That's the isLowLightBoostSupported selector, as above (to which only iOS 6 devices respond).

Wildaker
  • 2,533
  • 1
  • 17
  • 19
  • Got it working after I changed your `respondsToSelector` if statement to `isLowLightBoostSupported`. Thanks! – bmueller Oct 02 '12 at 03:08
  • Has anyone observed whether isLowLightBoostEnabled is ever getting true? I do not manage to do so on IOS 7.3 with an iPhone 5 even if I wrap the phone in a blanket. – tmanthey Oct 25 '13 at 09:53
  • Yes. If .isLowLightBoostSupported and .automaticallyEnablesLowLightBoostWhenAvailable = YES, then I have no problem with if ([[device] isLowLightBoostEnabled]) reading correctly. – Wildaker Oct 28 '13 at 08:57