Created
March 9, 2015 20:41
-
-
Save hasanadil/a3300b5dd8a89f86dc54 to your computer and use it in GitHub Desktop.
This file contains 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
//MARK: AVCaptureMetadataOutputObjectsDelegate | |
func captureOutput(captureOutput: AVCaptureOutput!, didOutputMetadataObjects metadataObjects: [AnyObject]!, fromConnection connection: AVCaptureConnection!) { | |
for metadata in metadataObjects { | |
for barcodeType in self.allowedBarcodes { | |
if metadata.type == barcodeType { | |
let barcode = (metadata as AVMetadataMachineReadableCodeObject).stringValue as String? | |
self.session.stopRunning() | |
if self.delegate != nil { | |
self.delegate!.didScanBarcode(barcode!) | |
} | |
break | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment