Manos Chorianopoulos

CampaignViewController optimizations

......@@ -798,15 +798,20 @@ var timer2: DispatchSourceTimer?
SwiftEventBus.post("refresh_vouchers")
// SwiftEventBus.post("open_my_rewards")
swiftApi().getUnifiedCouponsDeals { unifiedCoupons in
let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
let vc = storyboard.instantiateViewController(withIdentifier: "UnifiedCouponsViewController") as! SwiftWarplyFramework.UnifiedCouponsViewController
vc.isFromCampaignVC = true
self.navigationController?.pushViewController(vc, animated: true)
} failureCallback: { errorCode in
let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
let vc = storyboard.instantiateViewController(withIdentifier: "UnifiedCouponsViewController") as! SwiftWarplyFramework.UnifiedCouponsViewController
self.navigationController?.pushViewController(vc, animated: true)
}
// swiftApi().getUnifiedCouponsDeals { unifiedCoupons in
// let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
// let vc = storyboard.instantiateViewController(withIdentifier: "UnifiedCouponsViewController") as! SwiftWarplyFramework.UnifiedCouponsViewController
// self.navigationController?.pushViewController(vc, animated: true)
// } failureCallback: { errorCode in
// let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
// let vc = storyboard.instantiateViewController(withIdentifier: "UnifiedCouponsViewController") as! SwiftWarplyFramework.UnifiedCouponsViewController
// self.navigationController?.pushViewController(vc, animated: true)
// }
// let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
// let vc = storyboard.instantiateViewController(withIdentifier: "WalletViewController") as! SwiftWarplyFramework.WalletViewController
......
......@@ -21,6 +21,7 @@ import SwiftEventBus
public var unifiedCoupons:Array<swiftApi.UnifiedCouponModel> = []
public var smCoupons:Array<swiftApi.CouponItemModel> = []
public var smCouponsSelected:Array<swiftApi.CouponItemModel> = []
public var isFromCampaignVC: Bool = false
// A reference to the Select All image view for later use
var circleImageView: UIImageView!
......@@ -131,6 +132,12 @@ import SwiftEventBus
}
self.navigationController?.hideHairline()
if (self.isFromCampaignVC == true) {
swiftApi().getUnifiedCouponsDeals { unifiedCoupons in
} failureCallback: { errorCode in
}
}
}
// MARK: - Functions
......