title: How to dismiss camera after barcode scanning
body: <p>I want to dismiss camera once barcode is scanned successfully and return the result back to previous <code>UIViewController</code>.  </p>
  
  <p>I have tried following code for camera dismiss but it is not working.  </p>
  
  <pre><code>self.captureSession.stopRunning()  
  self.dismiss(animated: true, completion: nil)
  </code></pre>