Swiftpack.co - Package - ClockworkMonkeyStudios/QRCodeKit

QRCodeKit

  • Generate a QR Code.
  • Scan the QR Code.

Generate QR Code

Scan QR Code

Installation

Swift Package Manager

using Xcode:

File > Swift Packages > Add Package Dependency

How to use

  • import
import QRCodeKit
  • info.plist
Privacy - Camera Usage Description

QRCGenerator

  let url = "https://github.com/ClockworkMonkeyStudios/QRCodeKit.git"
  guard let qrCodeImage = QRCGenerator.generateQRCode(from: url) else { return }

QRCScannerView

import UIKit
import QRCodeKit

class ScannerViewController: UIViewController {

    @IBOutlet weak var scannerView: QRCScannerView!
    
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        scannerView.setupScanner(delegate: self)
        scannerView.startScanning()
    }

}

extension ScannerViewController: QRCScannerViewDelegate {
    
    func scannerView(_ scannerView: QRCScannerView, didFinishWithMessage message: String) {
        print(message)
        scannerView.stopScanning()
    }
    
    func scannerView(_ scannerView: QRCScannerView, didFailWithError error: Error) {
        print(error)
        scannerView.stopScanning()
    }
    
}

Github

link
Stars: 0

Dependencies

Used By

Total: 0