title: The barcode scanner goes stuck at the first time usage in ios,and while in the second click it works fine
body: <p>hi I am using phonegap barcodeplugin <code>wildabeast/BarcodeScanner</code> for scanning the barcodes.</p>
  
  <p>Here is my code</p>
  
  <pre><code>$('#scanbtn').on( "tap", function(evt){
  
                      scanner = null;
  
                      if(ival == 0){
                          ival = 1;
                          scanaction();
  
                      }
  
              });
  
              function scanaction(){
                  cordova.plugins.barcodeScanner.scan( function (result) {
  
                          scanText = result.text;
                          scanFormat = result.format;
                          scanCancelled = result.cancelled;
  
                      /* alert("We got a barcode\n" +
                                  "Result: " + scanText + "\n" +
                                  "Format: " + scanFormat + "\n" +
                                  "Cancelled: " + scanCancelled); */
  
                                  $.mobile.changePage('#pageTwo',{transition: "slide"});
  
  
                      }, function (error) {
                          ival = 0;
                          console.log("Scanning failed: ", error);
  
                      });
              }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/bo0zI.png" alt="This is the screen I&#39;m getting on the first scan,and the scanner goes stuck,and not scanning anymore"></p>
  
  <p>And the log I'm getting on this occasion is</p>
  
  <pre><code>    2014-05-23 10:41:26.629 ShareQ[283:60b] WARNING: -[&lt;AVCaptureVideoPreviewLayer: 0x155ba090&gt; isOrientationSupported] is deprecated.  Please use AVCaptureConnection's -isVideoOrientationSupported
      2014-05-23 10:41:26.735 ShareQ[283:60b] WARNING: -[&lt;AVCaptureVideoPreviewLayer: 0x155ba090&gt; setOrientation:] is deprecated.  Please use AVCaptureConnection's -setVideoOrientation:
      2014-05-23 10:41:27.300 ShareQ[283:60b] WARNING: -[&lt;AVCaptureVideoPreviewLayer: 0x155ba090&gt; setOrientation:] is deprecated.  Please use AVCaptureConnection's -setVideoOrientation:
      2014-05-23 10:41:27.310 ShareQ[283:60b] Warning: Attempt to present &lt;CDVbcsViewController: 0x155392f0&gt; on &lt;MainViewController: 0x1559e3c0&gt; while a presentation is in progress!
      2014-05-23 10:41:27.321 ShareQ[283:60b] Warning: Attempt to present &lt;CDVbcsViewController: 0x1553bb20&gt; on &lt;MainViewController: 0x1559e3c0&gt; while a presentation is in progress!
      2014-05-23 10:41:27.324 ShareQ[283:60b] Warning: Attempt to present &lt;CDVbcsViewController: 0x1553d2b0&gt; on &lt;MainViewController: 0x1559e3c0&gt; while a presentation is in progress!
      2014-05-23 10:41:27.326 ShareQ[283:60b] Warning: Attempt to present &lt;CDVbcsViewController: 0x155418b0&gt; on &lt;MainViewController: 0x1559e3c0&gt; while a presentation is in progress!
      2014-05-23 10:41:27.328 ShareQ[283:60b] Warning: Attempt to present &lt;CDVbcsViewController: 0x155456f0&gt; on &lt;MainViewController: 0x1559e3c0&gt; while a presentation is in progress!
      2014-05-23 10:41:27.331 ShareQ[283:60b] Warning: Attempt to present &lt;CDVbcsViewController: 0x155fa710&gt; on &lt;MainViewController: 0x1559e3c0&gt; while a presentation is in progress!
  </code></pre>