cloudConnect
cloudConnect

Reputation: 31

AVCaptureDevice Low Light Boost swift

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

Answers (1)

coding22
coding22

Reputation: 689

You don`t need that. Put this in the didMoveToView:

captureSession!.sessionPreset = AVCaptureSessionPresetPhoto

Upvotes: 1

Related Questions