Manos Chorianopoulos

Hide Barcode Section

......@@ -107,22 +107,42 @@ import AVFoundation
let barcodeString = constructBarcode() ?? ""
barcodeLabel.text = barcodeString
if let barcodeUIImage = RSUnifiedCodeGenerator.shared.generateCode(barcodeString, machineReadableCodeObjectType: AVMetadataObject.ObjectType.ean13.rawValue, targetSize: CGSize(width: self.uiscreen.width * 0.8, height: self.uiscreen.height * 0.1)) {
barcodeImage.image = barcodeUIImage
// Uncomment if Barcode Section is active again
// if let barcodeUIImage = RSUnifiedCodeGenerator.shared.generateCode(barcodeString, machineReadableCodeObjectType: AVMetadataObject.ObjectType.ean13.rawValue, targetSize: CGSize(width: self.uiscreen.width * 0.8, height: self.uiscreen.height * 0.1)) {
// barcodeImage.image = barcodeUIImage
//
// barcodeImageHeight.constant = self.uiscreen.height * 0.1
//
// showBarcodeButton.isHidden = false
// showBarcodeButtonHeight.constant = 50
// showBarcodeButtonTopSpace.constant = 10
//
// } else {
// barcodeImageHeight.constant = 0
//
// showBarcodeButton.isHidden = true
// showBarcodeButtonHeight.constant = 0
// showBarcodeButtonTopSpace.constant = 0
// }
barcodeImageHeight.constant = self.uiscreen.height * 0.1
// === Hide Barcode Section
barcodeImage.isHidden = true
barcodeImageHeight.constant = CGFloat(0)
barcodeLabel.isHidden = true
barcodeLabelHeight.constant = CGFloat(0)
showBarcodeButton.isHidden = false
showBarcodeButtonHeight.constant = 50
showBarcodeButtonTopSpace.constant = 10
borderViewHeight.constant = CGFloat(0)
borderView2Height.constant = CGFloat(0)
} else {
barcodeImageHeight.constant = 0
border1TopSpace.constant = CGFloat(0) // 20
barcodeImageTopSpace.constant = CGFloat(0) // 10
barcodeLabelTopSpace.constant = CGFloat(0) // 10
border2TopSpace.constant = CGFloat(0) // 15
showBarcodeButton.isHidden = true
showBarcodeButtonHeight.constant = 0
showBarcodeButtonTopSpace.constant = 0
}
// ===
showBarcodeButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 16)
showBarcodeButton.setTitle("Εμφάνιση barcode", for: .normal)
......@@ -225,7 +245,8 @@ import AVFoundation
termsTextView.textAlignment = .center
termsTextView.isScrollEnabled = false
toggleTerms()
// Uncomment if Barcode Section is active again
// toggleTerms()
toggleBarcode()
// Logs
......