[![CI Status](http://img.shields.io/travis/Lasith Hettiarachchi/LIHQRScanner.svg?style=flat)](https://travis-ci.org/Lasith Hettiarachchi/LIHQRScanner)
LIHQRScanner is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "LIHQRScanner"
To run the example project, clone the repo, and run pod install
from the Example directory first.
Declare an instance of LIHQRScanner
private var qrScanner: LIHQRScanner?
Add the following code inside viewDidLoad method
self.qrScanner = LIHQRScanner()
self.qrScanner?.delegate = self
Add the following code inside viewDidLayoutSubviews method
self.qrScanner?.initialize(videoContainer: self.scannerContainer)
self.qrScanner?.startSession(nil)
Implement from LIHQRScannerDelegate
class ViewController: UIViewController, LIHQRScannerDelegate
override qrDetected method
func qrDetected(qrString: String?, error: NSError?) {
if let qrCode = qrString {
print(qrCode)
}
}
iOS 8.0+
Only supports for portrait yet.
Lasith Hettiarachchi, [email protected]
LIHQRScanner is available under the MIT license. See the LICENSE file for more info.