Created
October 23, 2017 15:47
-
-
Save dpanzer/c1156784f797ac9c1f932de6242b8b22 to your computer and use it in GitHub Desktop.
BlinkReceipt Swift Integration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.swift | |
// BRSwiftDemo | |
// | |
// Created by Danny Panzer on 10/23/17. | |
// Copyright © 2017 BlinkReceipt. All rights reserved. | |
// | |
import UIKit | |
import BlinkReceipt | |
class ViewController: UIViewController, BRScanResultsDelegate { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
BRScanManager.shared().licenseKey = "Your license key here" | |
} | |
@IBAction func btnScanTouched(_ sender: UIButton) { | |
let scanOptions = BRScanOptions() | |
scanOptions.retailerId = WFRetailerId.unknown | |
BRScanManager.shared().startStaticCamera(from: self, scanOptions: scanOptions, with: self) | |
} | |
func didFinishScanning(_ cameraViewController: UIViewController!, with scanResults: BRScanResults!) { | |
cameraViewController.dismiss(animated: true, completion: nil) | |
//process scanResults object | |
} | |
func didCancelScanning(_ cameraViewController: UIViewController!) { | |
cameraViewController.dismiss(animated: true, completion: nil) | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment