Skip to main content
You are here: iOS SDK

QR Code Utilities

scanQR

public func scanQR(_ viewController: UIViewController) 

Scans a QR code using the device's camera and presents the scanner view controller.

Parameters:

  • viewController: The view controller from which to present the scanner.

Delegate to capture QR code information.

swift

extension PassportUtility: QRScannerCodeDelegate {
    /// It gets call when scanner did complete scanning QRCode.
    public func qrScanner(_ controller: UIViewController, scanDidComplete result: String) {
        self.delegation.qrScannerSuccess(result: result)
    }
    
    /// It gets call when scanner did fail while scanning QRCode.
    public func qrScannerDidFail(_ controller: UIViewController, error: QRCodeError) {
        self.delegation.qrScannerDidFail(error: error)
    }
    
    /// It gets call when scanner did cancel before scanning QRCode.
    public func qrScannerDidCancel(_ controller: UIViewController) {
        self.delegation.qrScannerDidCancel()
    }
    
}

activatePassScan

public func activatePassScan(_ viewController: UIViewController)

Processes the JSON string and performs actions based on the specified scan type.

Parameters:

  • viewController: The view controller from which to present the QRCodeScannerController.