title: IOS: how to take picture of scanned barcode?
body: <p>I am trying to capture the image of scanned bard code from camera and unable to find the way. </p>
  
  <pre><code>func captureOutput(captureOutput: AVCaptureOutput!, didOutputMetadataObjects metadataObjects: [AnyObject]!, fromConnection connection: AVCaptureConnection!) {
  
  
  for   metadata: AVMetadataObject in (metadataObjects as? [AVMetadataObject])!{
              for   type: String in barCodeTypes {
                  if  metadata.type == barcodeType
                  {
                   //do something and break
                  }
             }
  }
  </code></pre>
  
  <p>This method is called when bar code scanned is success, I need to get UIImage of scanned barcode. Help me out with this.</p>