1
votes

I'm using AVFoundation in order to implement barcode scanning. It works well, but I want to decide in which area the barcode has to be centered (for example on the top of the screen). How can I do this?

1

1 Answers

4
votes

Set the rectOfInterest on your AVCaptureMetaDataOutput instance:

self.metadataOutput.rectOfInterest = [self.previewLayer metadataOutputRectOfInterestForRect:myRectOfInterest];