Manos Chorianopoulos

barcode commented

......@@ -10,8 +10,9 @@ import SwiftUI
import Combine
import Foundation
import UIKit
import RSBarcodes_Swift
import AVFoundation
// TODO: Uncomment for barcode
//import RSBarcodes_Swift
//import AVFoundation
......@@ -196,18 +197,19 @@ extension CouponBarcodeView {
// let isValid = RSUnifiedCodeValidator.shared.isValid(barcodeString, machineReadableCodeObjectType: AVMetadataObject.ObjectType.ean13.rawValue)
if let barcodeImage = RSUnifiedCodeGenerator.shared.generateCode(barcodeString, machineReadableCodeObjectType: AVMetadataObject.ObjectType.ean13.rawValue, targetSize: CGSize(width: self.uiscreen.width * 0.8, height: self.uiscreen.height * 0.1)) {
// TODO: Uncomment for barcode
// if let barcodeImage = RSUnifiedCodeGenerator.shared.generateCode(barcodeString, machineReadableCodeObjectType: AVMetadataObject.ObjectType.ean13.rawValue, targetSize: CGSize(width: self.uiscreen.width * 0.8, height: self.uiscreen.height * 0.1)) {
//
VStack(alignment: .center) {
Image(uiImage: barcodeImage)
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: self.uiscreen.width * 0.8, height: self.uiscreen.height * 0.1)
}
.frame(maxWidth: .infinity)
.padding(.top, self.uiscreen.height * 0.01)
}
////
// VStack(alignment: .center) {
// Image(uiImage: barcodeImage)
// .resizable()
// .aspectRatio(contentMode: .fit)
// .frame(width: self.uiscreen.width * 0.8, height: self.uiscreen.height * 0.1)
// }
// .frame(maxWidth: .infinity)
// .padding(.top, self.uiscreen.height * 0.01)
// }
Text(barcodeString)
......