Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Lasithih/LIHQRScanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LIHQRScanner

[![CI Status](http://img.shields.io/travis/Lasith Hettiarachchi/LIHQRScanner.svg?style=flat)](https://travis-ci.org/Lasith Hettiarachchi/LIHQRScanner) Version License Platform

Installation

LIHQRScanner is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "LIHQRScanner"

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Step 1

Declare an instance of LIHQRScanner

private var qrScanner: LIHQRScanner?

Step 2

Add the following code inside viewDidLoad method

self.qrScanner = LIHQRScanner()
self.qrScanner?.delegate = self

Step 3

Add the following code inside viewDidLayoutSubviews method

self.qrScanner?.initialize(videoContainer: self.scannerContainer)
self.qrScanner?.startSession(nil)

Step 4

Implement from LIHQRScannerDelegate

class ViewController: UIViewController, LIHQRScannerDelegate

Step 5

override qrDetected method

func qrDetected(qrString: String?, error: NSError?) {

    if let qrCode = qrString {
        print(qrCode)
    }
}

Requirements

iOS 8.0+

Known Issues

Only supports for portrait yet.

Author

Lasith Hettiarachchi, [email protected]

License

LIHQRScanner is available under the MIT license. See the LICENSE file for more info.