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