Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
Pod
 
 
 
 
 
 
 
 
 
 

README.md

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, lasithih@yahoo.com

License

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

You can’t perform that action at this time.