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")
    }
}

Save snippets that work with our extensions

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