Created
May 10, 2018 19:50
-
-
Save azamsharp/fa78547213050f41d5ecb95dedb196d7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) { | |
if let barcodeDetector = self.barcodeDetector { | |
let visionImage = VisionImage(buffer: sampleBuffer) | |
barcodeDetector.detect(in: visionImage) { (barcodes, error) in | |
if let error = error { | |
print(error.localizedDescription) | |
return | |
} | |
for barcode in barcodes! { | |
print(barcode.rawValue!) | |
self.barCodeRawValueLabel.text = barcode.rawValue! | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment