Snippets Collections
extension MerchantTabBarViewController: QRScannerCodeDelegate {
    
    func presentQRView(){
        let activityView = activityIndicatorView()
        activityView.startAnimating()
        let scanner = QRCodeScannerController()
        scanner.delegate = self
        scanner.modalTransitionStyle = .coverVertical
        self.present(scanner, animated: true) {
            activityView.stopAnimating()
        }
    }
    
    func qrScanner(_ controller: UIViewController, scanDidComplete result: String) {
        print("result:\(result)")
    }

    func qrScannerDidFail(_ controller: UIViewController, error: String) {
        print("error:\(error)")
    }
    
    func qrScannerDidCancel(_ controller: UIViewController) {
        print("SwiftQRScanner did cancel")
    }
}
star

Tue Mar 08 2022 10:09:08 GMT+0000 (Coordinated Universal Time)

#ios #swift #qr #qr #qr #qrcode #qrcode

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension