Manos Chorianopoulos

add SwiftEventBus lib

......@@ -10,6 +10,7 @@
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 */; };
1EBF5F072840E13F00B8B17F /* SwiftEventBus in Frameworks */ = {isa = PBXBuildFile; productRef = 1EBF5F062840E13F00B8B17F /* SwiftEventBus */; };
7630AD9A6242D60846D6750C /* Pods_SwiftWarplyFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0D5F56DD4E5371A50AD2D87 /* Pods_SwiftWarplyFramework.framework */; };
E6A77853282933340045BBA8 /* SwiftWarplyFramework.docc in Sources */ = {isa = PBXBuildFile; fileRef = E6A77852282933340045BBA8 /* SwiftWarplyFramework.docc */; };
E6A77854282933340045BBA8 /* SwiftWarplyFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = E6A77851282933340045BBA8 /* SwiftWarplyFramework.h */; settings = {ATTRIBUTES = (Public, ); }; };
......@@ -281,6 +282,7 @@
files = (
1E2966EA2837A21D00F83FAC /* RSBarcodes_Swift in Frameworks */,
7630AD9A6242D60846D6750C /* Pods_SwiftWarplyFramework.framework in Frameworks */,
1EBF5F072840E13F00B8B17F /* SwiftEventBus in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -645,6 +647,7 @@
name = SwiftWarplyFramework;
packageProductDependencies = (
1E2966E92837A21D00F83FAC /* RSBarcodes_Swift */,
1EBF5F062840E13F00B8B17F /* SwiftEventBus */,
);
productName = SwiftWarplyFramework;
productReference = E6A7784E282933340045BBA8 /* SwiftWarplyFramework.framework */;
......@@ -676,6 +679,7 @@
mainGroup = E6A77844282933340045BBA8;
packageReferences = (
1E2966E82837A21D00F83FAC /* XCRemoteSwiftPackageReference "RSBarcodes_Swift" */,
1EBF5F052840E13F00B8B17F /* XCRemoteSwiftPackageReference "SwiftEventBus" */,
);
productRefGroup = E6A7784F282933340045BBA8 /* Products */;
projectDirPath = "";
......@@ -1029,6 +1033,14 @@
minimumVersion = 5.0.0;
};
};
1EBF5F052840E13F00B8B17F /* XCRemoteSwiftPackageReference "SwiftEventBus" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/cesarferreira/SwiftEventBus";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 5.0.0;
};
};
/* End XCRemoteSwiftPackageReference section */
/* Begin XCSwiftPackageProductDependency section */
......@@ -1037,6 +1049,11 @@
package = 1E2966E82837A21D00F83FAC /* XCRemoteSwiftPackageReference "RSBarcodes_Swift" */;
productName = RSBarcodes_Swift;
};
1EBF5F062840E13F00B8B17F /* SwiftEventBus */ = {
isa = XCSwiftPackageProductDependency;
package = 1EBF5F052840E13F00B8B17F /* XCRemoteSwiftPackageReference "SwiftEventBus" */;
productName = SwiftEventBus;
};
/* 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"
}
"pins" : [
{
"identity" : "rsbarcodes_swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/yeahdongcn/RSBarcodes_Swift",
"state" : {
"revision" : "86d8b1a1439e7edb19793d17732b15fd784a0a15",
"version" : "5.1.1"
}
]
},
"version": 1
},
{
"identity" : "swifteventbus",
"kind" : "remoteSourceControl",
"location" : "https://github.com/cesarferreira/SwiftEventBus",
"state" : {
"revision" : "a30ff35e616f507d8a8d122dac32a2150371a87e",
"version" : "5.1.0"
}
}
],
"version" : 2
}
......
......@@ -6,9 +6,9 @@
//
import UIKit
//import WarplySDKFrameworkIOS
import RSBarcodes_Swift
import AVFoundation
import SwiftEventBus
@objc class CouponBarcodeViewController: UIViewController {
@IBOutlet weak var backgroundImage: UIImageView!
......@@ -146,6 +146,8 @@ import AVFoundation
@IBAction func redeemButtomAction(_ sender: Any) {
// TODO: Add redeem action
SwiftEventBus.post("couponBarcodeRedeem", sender: coupon)
let alert = UIAlertController(title: "Το κουπόνι σου ενεργοποιήθηκε", message: "Μπορείς να το βρεις στην αρχική οθόνη της εφαρμογής και στην ενότητα ενεργά δώρα!", preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in
......
......@@ -6,6 +6,7 @@
//
import UIKit
import SwiftEventBus
@objc class CouponViewController: UIViewController {
@IBOutlet weak var mainView: UIView!
......@@ -72,6 +73,8 @@ import UIKit
// MARK: - Actions
@IBAction func redeemButtomAction(_ sender: Any) {
// SwiftEventBus.post("couponRedeem", sender: coupon)
let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
let vc = storyboard.instantiateViewController(withIdentifier: "MakeItAPresentViewController") as UIViewController
self.navigationController?.pushViewController(vc, animated: true)
......
......@@ -7,7 +7,6 @@
import Foundation
import UIKit
//import WarplySDKFrameworkIOS
@objc class CouponsTableViewCell: UITableViewCell {
@IBOutlet weak var couponBgImage: UIImageView!
......
......@@ -7,7 +7,7 @@
import Foundation
import UIKit
//import WarplySDKFrameworkIOS
import SwiftEventBus
@objc public class CouponsViewController: UIViewController {
@IBOutlet weak var backgroundImage: UIImageView!
......@@ -83,6 +83,8 @@ extension CouponsViewController: UITableViewDelegate, UITableViewDataSource{
public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
SwiftEventBus.post("couponBarcodePressed", sender: coupons[indexPath.row])
let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
let vc = storyboard.instantiateViewController(withIdentifier: "CouponBarcodeViewController") as! CouponBarcodeViewController
vc.coupon = coupons[indexPath.row]
......