Manos Chorianopoulos

barcode lib v11

...@@ -161,12 +161,12 @@ extension CouponBarcodeView { ...@@ -161,12 +161,12 @@ extension CouponBarcodeView {
161 161
162 // let isValid = RSUnifiedCodeValidator.shared.isValid("1234567891234", machineReadableCodeObjectType: AVMetadataObject.ObjectType.ean13.rawValue) 162 // let isValid = RSUnifiedCodeValidator.shared.isValid("1234567891234", machineReadableCodeObjectType: AVMetadataObject.ObjectType.ean13.rawValue)
163 163
164 - if let gen = RSUnifiedCodeGenerator.shared { 164 +// if let gen = RSUnifiedCodeGenerator.shared {
165 165
166 // gen.fillColor = UIColor.white 166 // gen.fillColor = UIColor.white
167 // gen.strokeColor = UIColor.black 167 // gen.strokeColor = UIColor.black
168 168
169 - if let image = gen.generateCode("1234567891234", machineReadableCodeObjectType: AVMetadataObject.ObjectType.ean13.rawValue, targetSize: CGSize(width: 300, height: 300)) { 169 + if let barcodeImage = RSUnifiedCodeGenerator.shared.generateCode("1234567891234", machineReadableCodeObjectType: AVMetadataObject.ObjectType.ean13.rawValue, targetSize: CGSize(width: 300, height: 300)) {
170 170
171 // VStack(alignment: .center) { 171 // VStack(alignment: .center) {
172 // Image(uiImage: image) 172 // Image(uiImage: image)
...@@ -178,12 +178,14 @@ extension CouponBarcodeView { ...@@ -178,12 +178,14 @@ extension CouponBarcodeView {
178 // .frame(maxWidth: .infinity) 178 // .frame(maxWidth: .infinity)
179 // .padding(.top, self.uiscreen.height * 0.01) 179 // .padding(.top, self.uiscreen.height * 0.01)
180 180
181 - Image(uiImage: image) 181 + Image(uiImage: barcodeImage)
182 -// .resizable() 182 + .renderingMode(.original)
183 -// .aspectRatio(contentMode: .fit) 183 + .resizable()
184 + .aspectRatio(contentMode: .fit)
185 + .frame(width: 300, height: 300)
184 // .frame(width: self.uiscreen.width * 0.8, height: self.uiscreen.height * 0.05) 186 // .frame(width: self.uiscreen.width * 0.8, height: self.uiscreen.height * 0.05)
185 } 187 }
186 - } 188 +// }
187 189
188 // generateBarcode(from: "1234567891234") 190 // generateBarcode(from: "1234567891234")
189 // ? 191 // ?
......