//
//  ViewController.swift
//  Test
//
//  Created by eddie on 2016/2/23.
//  Copyright © 2016年 penpower. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    let example = IDCardSDKExample();
    
    
    @IBOutlet weak var captureButton: UIButton!
    @IBOutlet weak var recognizeButton: UIButton!
    @IBOutlet weak var resultLabel: UILabel!
    
    override func viewDidLoad()
    {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        
    }
    
    @IBAction func onClickCapture(_ sender: UIButton)
    {
        example.presentCaptureInterface(self)
    }
    
    @IBAction func onClickRecognize(_ sender: UIButton)
    {
        let resultString = example.recognize()
        
        let alertController = UIAlertController(title: "Recognition result", message: resultString, preferredStyle: UIAlertControllerStyle.alert)
        alertController.addAction(UIAlertAction(title: "Ok", style: UIAlertActionStyle.default, handler: nil))
        self.present(alertController, animated: true, completion: nil)
    }
}

