Use ZXing library to generate QR codes

This commit is contained in:
Andy Uhnak
2022-06-28 18:11:22 +01:00
parent 49e9c5cab2
commit 42f7508538
3 changed files with 26 additions and 26 deletions
@@ -17,6 +17,7 @@
*/
import UIKit
import MatrixSDK
final class KeyVerificationVerifyByScanningViewController: UIViewController {
@@ -215,7 +216,12 @@ final class KeyVerificationVerifyByScanningViewController: UIViewController {
private func qrCodeImage(from data: Data) -> UIImage? {
let codeGenerator = QRCodeGenerator()
return codeGenerator.generateCode(from: data, with: self.codeImageView.frame.size)
do {
return try codeGenerator.generateCode(from: data, with: codeImageView.frame.size)
} catch {
MXLog.error("[KeyVerificationVerifyByScanningViewController] qrCodeImage: cannot generate QR code - \(error)")
return nil
}
}
private func presentQRCodeReader(animated: Bool) {