Manos Chorianopoulos

add RSBarcodes_Swift library

...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
7 objects = { 7 objects = {
8 8
9 /* Begin PBXBuildFile section */ 9 /* Begin PBXBuildFile section */
10 + 1E2966EA2837A21D00F83FAC /* RSBarcodes_Swift in Frameworks */ = {isa = PBXBuildFile; productRef = 1E2966E92837A21D00F83FAC /* RSBarcodes_Swift */; };
10 1E74838D28378AF40042A589 /* CouponBarcodeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E74838C28378AF40042A589 /* CouponBarcodeViewController.swift */; }; 11 1E74838D28378AF40042A589 /* CouponBarcodeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E74838C28378AF40042A589 /* CouponBarcodeViewController.swift */; };
11 1EA1AF0A2835346A008998AA /* CouponsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EA1AF092835346A008998AA /* CouponsTableViewCell.swift */; }; 12 1EA1AF0A2835346A008998AA /* CouponsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EA1AF092835346A008998AA /* CouponsTableViewCell.swift */; };
12 7630AD9A6242D60846D6750C /* Pods_SwiftWarplyFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0D5F56DD4E5371A50AD2D87 /* Pods_SwiftWarplyFramework.framework */; }; 13 7630AD9A6242D60846D6750C /* Pods_SwiftWarplyFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0D5F56DD4E5371A50AD2D87 /* Pods_SwiftWarplyFramework.framework */; };
...@@ -278,6 +279,7 @@ ...@@ -278,6 +279,7 @@
278 isa = PBXFrameworksBuildPhase; 279 isa = PBXFrameworksBuildPhase;
279 buildActionMask = 2147483647; 280 buildActionMask = 2147483647;
280 files = ( 281 files = (
282 + 1E2966EA2837A21D00F83FAC /* RSBarcodes_Swift in Frameworks */,
281 7630AD9A6242D60846D6750C /* Pods_SwiftWarplyFramework.framework in Frameworks */, 283 7630AD9A6242D60846D6750C /* Pods_SwiftWarplyFramework.framework in Frameworks */,
282 ); 284 );
283 runOnlyForDeploymentPostprocessing = 0; 285 runOnlyForDeploymentPostprocessing = 0;
...@@ -641,6 +643,9 @@ ...@@ -641,6 +643,9 @@
641 dependencies = ( 643 dependencies = (
642 ); 644 );
643 name = SwiftWarplyFramework; 645 name = SwiftWarplyFramework;
646 + packageProductDependencies = (
647 + 1E2966E92837A21D00F83FAC /* RSBarcodes_Swift */,
648 + );
644 productName = SwiftWarplyFramework; 649 productName = SwiftWarplyFramework;
645 productReference = E6A7784E282933340045BBA8 /* SwiftWarplyFramework.framework */; 650 productReference = E6A7784E282933340045BBA8 /* SwiftWarplyFramework.framework */;
646 productType = "com.apple.product-type.framework"; 651 productType = "com.apple.product-type.framework";
...@@ -669,6 +674,9 @@ ...@@ -669,6 +674,9 @@
669 Base, 674 Base,
670 ); 675 );
671 mainGroup = E6A77844282933340045BBA8; 676 mainGroup = E6A77844282933340045BBA8;
677 + packageReferences = (
678 + 1E2966E82837A21D00F83FAC /* XCRemoteSwiftPackageReference "RSBarcodes_Swift" */,
679 + );
672 productRefGroup = E6A7784F282933340045BBA8 /* Products */; 680 productRefGroup = E6A7784F282933340045BBA8 /* Products */;
673 projectDirPath = ""; 681 projectDirPath = "";
674 projectRoot = ""; 682 projectRoot = "";
...@@ -1011,6 +1019,25 @@ ...@@ -1011,6 +1019,25 @@
1011 defaultConfigurationName = Release; 1019 defaultConfigurationName = Release;
1012 }; 1020 };
1013 /* End XCConfigurationList section */ 1021 /* End XCConfigurationList section */
1022 +
1023 +/* Begin XCRemoteSwiftPackageReference section */
1024 + 1E2966E82837A21D00F83FAC /* XCRemoteSwiftPackageReference "RSBarcodes_Swift" */ = {
1025 + isa = XCRemoteSwiftPackageReference;
1026 + repositoryURL = "https://github.com/yeahdongcn/RSBarcodes_Swift";
1027 + requirement = {
1028 + kind = upToNextMajorVersion;
1029 + minimumVersion = 5.0.0;
1030 + };
1031 + };
1032 +/* End XCRemoteSwiftPackageReference section */
1033 +
1034 +/* Begin XCSwiftPackageProductDependency section */
1035 + 1E2966E92837A21D00F83FAC /* RSBarcodes_Swift */ = {
1036 + isa = XCSwiftPackageProductDependency;
1037 + package = 1E2966E82837A21D00F83FAC /* XCRemoteSwiftPackageReference "RSBarcodes_Swift" */;
1038 + productName = RSBarcodes_Swift;
1039 + };
1040 +/* End XCSwiftPackageProductDependency section */
1014 }; 1041 };
1015 rootObject = E6A77845282933340045BBA8 /* Project object */; 1042 rootObject = E6A77845282933340045BBA8 /* Project object */;
1016 } 1043 }
......
1 +{
2 + "object": {
3 + "pins": [
4 + {
5 + "package": "RSBarcodes_Swift",
6 + "repositoryURL": "https://github.com/yeahdongcn/RSBarcodes_Swift",
7 + "state": {
8 + "branch": null,
9 + "revision": "86d8b1a1439e7edb19793d17732b15fd784a0a15",
10 + "version": "5.1.1"
11 + }
12 + }
13 + ]
14 + },
15 + "version": 1
16 +}
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
7 7
8 import UIKit 8 import UIKit
9 import WarplySDKFrameworkIOS 9 import WarplySDKFrameworkIOS
10 +import RSBarcodes_Swift
11 +import AVFoundation
10 12
11 @objc class CouponBarcodeViewController: UIViewController { 13 @objc class CouponBarcodeViewController: UIViewController {
12 @IBOutlet weak var backgroundImage: UIImageView! 14 @IBOutlet weak var backgroundImage: UIImageView!
...@@ -18,6 +20,8 @@ import WarplySDKFrameworkIOS ...@@ -18,6 +20,8 @@ import WarplySDKFrameworkIOS
18 @IBOutlet weak var discriptionLabel: UILabel! 20 @IBOutlet weak var discriptionLabel: UILabel!
19 @IBOutlet weak var couponView: UIView! 21 @IBOutlet weak var couponView: UIView!
20 @IBOutlet weak var couponNumberLabel: UILabel! 22 @IBOutlet weak var couponNumberLabel: UILabel!
23 + @IBOutlet weak var barcodeImage: UIImageView!
24 + @IBOutlet weak var barcodeImageHeight: NSLayoutConstraint!
21 @IBOutlet weak var barcodeLabel: UILabel! 25 @IBOutlet weak var barcodeLabel: UILabel!
22 @IBOutlet weak var expirationLabel: UILabel! 26 @IBOutlet weak var expirationLabel: UILabel!
23 @IBOutlet weak var redeemButton: UIButton! 27 @IBOutlet weak var redeemButton: UIButton!
...@@ -61,6 +65,14 @@ import WarplySDKFrameworkIOS ...@@ -61,6 +65,14 @@ import WarplySDKFrameworkIOS
61 65
62 let barcodeString = constructBarcode() ?? "" 66 let barcodeString = constructBarcode() ?? ""
63 barcodeLabel.text = barcodeString 67 barcodeLabel.text = barcodeString
68 +
69 + 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)) {
70 + barcodeImage.image = barcodeUIImage
71 +
72 + barcodeImageHeight.constant = self.uiscreen.height * 0.1
73 + } else {
74 + barcodeImageHeight.constant = 0
75 + }
64 76
65 expirationLabel.text = "Το κουπόνι ισχύει έως " + (coupon?.expiration ?? "") 77 expirationLabel.text = "Το κουπόνι ισχύει έως " + (coupon?.expiration ?? "")
66 78
......