Reputation: 31
Does anyone know how to set up low light boost for your ios camera app? This is the code i have but can't make it to work.
let backCamera = AVCaptureDevice.defaultDevice(withMediaType: AVMediaTypeVideo)
do {
try backCamera?.lockForConfiguration()
if (backCamera?.isLowLightBoostSupported == true) {
backCamera?.automaticallyEnablesLowLightBoostWhenAvailable = true
}
backCamera?.unlockForConfiguration()
}
catch{
print(error)
}
Upvotes: 3
Views: 563
Reputation: 689
You don`t need that. Put this in the didMoveToView:
captureSession!.sessionPreset = AVCaptureSessionPresetPhoto
Upvotes: 1