I was using this library which is <https://github.com/CosmicMind/Material>. Everything is already working well aside from one which requires a bit of optimization, 

I've tried this one which works pretty well with improved lighting in the dark, it is pretty much useful for devices that don't have flash such as iPads. 

<https://github.com/ooper-shlab/AVCamManual-Swift>

I can't seem to get where the lighting optimization happens in the code. I would've help if I have figured out. 

The preview really would look a lot darker using the Capture API of material. 

Screenshots of each can be seen below:
The demo for Material's Capture Api:
[![Cosmicmind's Capture demo](https://i.stack.imgur.com/sZIot.jpg)](https://i.stack.imgur.com/sZIot.jpg)

The demo for AVFoundation:[![AVCamManual Demo screenshot](https://i.stack.imgur.com/Y8bym.jpg)](https://i.stack.imgur.com/Y8bym.jpg)