- In your
Info.plist
add the keyNSCameraUsageDescription
with valueWe are using the camera to scan QR codes
(or anything you see fit)
Wherever you want to scan a QR code, just call
let qrScanner = RSQRScannerViewController()
qrScanner.scanResult = { result in
print(result)
}
qrScanner.failedInit = {
print("Failed to init capture device")
}
self.present(qrScanner, animated: true)
RSQRScannerViewController is available under the MPL-2.0 license. See the LICENSE file for more info.