     }
 }
 
+// MARK: Other Private Methods
+
+extension ViewController {
+    
+    func showAlertDialog(title: String, message: String) {
+        let alertDialog = UIAlertController.init(title: title, message: message, preferredStyle: .alert)
+        alertDialog.addAction(UIAlertAction.init(title: "OK", style: .default, handler: { (action) in
+            alertDialog.dismiss(animated: true, completion: nil)
+        }))
+        self.present(alertDialog, animated: true, completion: nil)
+    }
+}
+
+// MARK: EvrythngDelegate
 extension ViewController: EvrythngDelegate {
     
     func evrythngInitializationDidSucceed() {

import UIKit
import EvrythngiOS
import Moya

class ViewController: UIViewController {

    // MARK: - IBActions
    
    @IBAction func actionScan(_ sender: UIButton) {
        let evrythngScanner = EvrythngScanner.init(presentingVC: self)
        evrythngScanner.scanBarcode()
        //let result = evrythngScanner.identify(barcode: "own_vc_1234567")
        //print("Query Scan Result: \(result.result)")
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        Evrythng.initialize(delegate: self)

        if let user = User(jsonData: ["firstName": "Mymymy", "lastName": "lastlastlast", "email": "test@email.com", "password": "testpassword"]) {
            
            EvrythngUserCreator(user: user).execute(completionHandler: { (user, err) in
                if(err != nil) {

    }
}

extension ViewController: EvrythngScannerResultDelegate {
    public func didFinishScanResult(result: String, error: Swift.Error?) {
        if let err = error {
            print("Default Scan Result Error: \(err.localizedDescription)")
            return
        } else {
            print("Default Scan Result Successful: \(result)")
        }
    }
}

// MARK: - QRCodeReaderViewController Delegate Methods

extension ViewController: QRCodeReaderViewControllerDelegate {
    
    func reader(_ reader: QRCodeReaderViewController, didScanResult result: QRCodeReaderResult) {
        reader.stopScanning()
        
        dismiss(animated: true, completion: nil)
    }
    
    //This is an optional delegate method, that allows you to be notified when the user switches the cameraName
    //By pressing on the switch camera button
    func reader(_ reader: QRCodeReaderViewController, didSwitchCamera newCaptureDevice: AVCaptureDeviceInput) {
        if let cameraName = newCaptureDevice.device.localizedName {
            print("Switching capturing to: \(cameraName)")
        }
    }
    
    func readerDidCancel(_ reader: QRCodeReaderViewController) {
        reader.stopScanning()
        
        dismiss(animated: true, completion: nil)
    }
}
