I am building a QR code scanner with Swift and everything works in that regard. The issue I have is that I am trying to make only a small area of the entire visible A
A
I wrote the following:
videoPreviewLayer?.frame = view.layer.bounds videoPreviewLayer?.videoGravity = AVLayerVideoGravityResizeAspectFill
And this worked for me, but I still don't know why.