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") } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter