Skip to content

Instantly share code, notes, and snippets.

@dpanzer
Created October 23, 2017 15:47
Show Gist options
  • Save dpanzer/c1156784f797ac9c1f932de6242b8b22 to your computer and use it in GitHub Desktop.
Save dpanzer/c1156784f797ac9c1f932de6242b8b22 to your computer and use it in GitHub Desktop.
BlinkReceipt Swift Integration
//
// 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