     // AVCaptureMetadataOutputObjectsDelegate
     
     func captureOutput(captureOutput: AVCaptureOutput!, didOutputMetadataObjects metadataObjects: AnyObject[]!, fromConnection connection: AVCaptureConnection!) {
-        
+        var barcodeObjects : Array<AVMetadataMachineReadableCodeObject> = []
+        for metadataObject : AnyObject in metadataObjects {
+            let transformedMetadataObject = layer!.transformedMetadataObjectForMetadataObject(metadataObject as AVMetadataObject)
+            if transformedMetadataObject.isKindOfClass(AVMetadataMachineReadableCodeObject.self) {
+                let barcodeObject = transformedMetadataObject as AVMetadataMachineReadableCodeObject
+                barcodeObjects += barcodeObject
+            }
+        }
+        if barcodeObjects.count > 0 && barcodesHandler {
+            barcodesHandler!(barcodeObjects)
+        }
     }
 }

    let device = AVCaptureDevice.defaultDeviceWithMediaType(AVMediaTypeVideo)
    let session = AVCaptureSession()
    
    var tapHandler: ((CGPoint) -> Void)?
    var codesHandler: ((Array<AVMetadataMachineReadableCodeObject>) -> Void)?
    
    func tap(gesture: UITapGestureRecognizer) {
        let tapPoint = gesture.locationInView(self.view)

        let input = AVCaptureDeviceInput(device: device, error: &error)
        if error {
            println(error.description)
            return
        }
        
        if session.canAddInput(input) {
            session.addInput(input)
        }
        
        layer = AVCaptureVideoPreviewLayer(session: session)
        layer!.videoGravity = AVLayerVideoGravityResizeAspectFill
        layer!.frame = self.view.bounds
        self.view.layer.addSublayer(layer!)
        
        let output = AVCaptureMetadataOutput()
        let queue = dispatch_queue_create("com.pdq.rsbarcodes.metadata", DISPATCH_QUEUE_CONCURRENT)
        output.setMetadataObjectsDelegate(self, queue: queue)
        if session.canAddOutput(output) {
            session.addOutput(output)
