I am building an iOS app using Swift which requires QR code scanner functionality.
I have implemented a QR code scanner using AVFoundation, right now my capture screen looks same as a video recording screen i.e. AVCaptureVideoPreviewLayer
shows what is being captured by the camera.
But since it is a QR code scanner and not a regular image or video capture, I would like my VideoPreviewLayer
to look like this:
I understand this can be achieved by adding another VideoPreviewLayer
on top of one VideoPreviewLayer
.
My questions are:
How do I add the borders only to the edges in the upper (or smaller) preview layer?
How do I change the brightness level for the
VideoPreviewLayer
in the background?How to ignore media captured by the the background layer?