Manos Chorianopoulos

add RSBarcodes_Swift library

......@@ -7,6 +7,7 @@
objects = {
/* Begin PBXBuildFile section */
1E2966EA2837A21D00F83FAC /* RSBarcodes_Swift in Frameworks */ = {isa = PBXBuildFile; productRef = 1E2966E92837A21D00F83FAC /* RSBarcodes_Swift */; };
1E74838D28378AF40042A589 /* CouponBarcodeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E74838C28378AF40042A589 /* CouponBarcodeViewController.swift */; };
1EA1AF0A2835346A008998AA /* CouponsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EA1AF092835346A008998AA /* CouponsTableViewCell.swift */; };
7630AD9A6242D60846D6750C /* Pods_SwiftWarplyFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0D5F56DD4E5371A50AD2D87 /* Pods_SwiftWarplyFramework.framework */; };
......@@ -278,6 +279,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
1E2966EA2837A21D00F83FAC /* RSBarcodes_Swift in Frameworks */,
7630AD9A6242D60846D6750C /* Pods_SwiftWarplyFramework.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
......@@ -641,6 +643,9 @@
dependencies = (
);
name = SwiftWarplyFramework;
packageProductDependencies = (
1E2966E92837A21D00F83FAC /* RSBarcodes_Swift */,
);
productName = SwiftWarplyFramework;
productReference = E6A7784E282933340045BBA8 /* SwiftWarplyFramework.framework */;
productType = "com.apple.product-type.framework";
......@@ -669,6 +674,9 @@
Base,
);
mainGroup = E6A77844282933340045BBA8;
packageReferences = (
1E2966E82837A21D00F83FAC /* XCRemoteSwiftPackageReference "RSBarcodes_Swift" */,
);
productRefGroup = E6A7784F282933340045BBA8 /* Products */;
projectDirPath = "";
projectRoot = "";
......@@ -1011,6 +1019,25 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
/* Begin XCRemoteSwiftPackageReference section */
1E2966E82837A21D00F83FAC /* XCRemoteSwiftPackageReference "RSBarcodes_Swift" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/yeahdongcn/RSBarcodes_Swift";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 5.0.0;
};
};
/* End XCRemoteSwiftPackageReference section */
/* Begin XCSwiftPackageProductDependency section */
1E2966E92837A21D00F83FAC /* RSBarcodes_Swift */ = {
isa = XCSwiftPackageProductDependency;
package = 1E2966E82837A21D00F83FAC /* XCRemoteSwiftPackageReference "RSBarcodes_Swift" */;
productName = RSBarcodes_Swift;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = E6A77845282933340045BBA8 /* Project object */;
}
......
{
"object": {
"pins": [
{
"package": "RSBarcodes_Swift",
"repositoryURL": "https://github.com/yeahdongcn/RSBarcodes_Swift",
"state": {
"branch": null,
"revision": "86d8b1a1439e7edb19793d17732b15fd784a0a15",
"version": "5.1.1"
}
}
]
},
"version": 1
}
......@@ -7,6 +7,8 @@
import UIKit
import WarplySDKFrameworkIOS
import RSBarcodes_Swift
import AVFoundation
@objc class CouponBarcodeViewController: UIViewController {
@IBOutlet weak var backgroundImage: UIImageView!
......@@ -18,6 +20,8 @@ import WarplySDKFrameworkIOS
@IBOutlet weak var discriptionLabel: UILabel!
@IBOutlet weak var couponView: UIView!
@IBOutlet weak var couponNumberLabel: UILabel!
@IBOutlet weak var barcodeImage: UIImageView!
@IBOutlet weak var barcodeImageHeight: NSLayoutConstraint!
@IBOutlet weak var barcodeLabel: UILabel!
@IBOutlet weak var expirationLabel: UILabel!
@IBOutlet weak var redeemButton: UIButton!
......@@ -62,6 +66,14 @@ import WarplySDKFrameworkIOS
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
barcodeImageHeight.constant = self.uiscreen.height * 0.1
} else {
barcodeImageHeight.constant = 0
}
expirationLabel.text = "Το κουπόνι ισχύει έως " + (coupon?.expiration ?? "")
redeemButton.titleLabel?.font = UIFont.systemFont(ofSize: 15, weight: .medium)
......