Luciano
Luciano

Reputation: 1238

iOS: AVFoundation Barcode Scanning - change scanning area

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?

Upvotes: 1

Views: 1428

Answers (1)

Kris Flesner
Kris Flesner

Reputation: 428

Set the rectOfInterest on your AVCaptureMetaDataOutput instance:

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

Upvotes: 4

Related Questions