Manos Chorianopoulos

add openCouponset func

...@@ -2207,6 +2207,31 @@ public class swiftApi { ...@@ -2207,6 +2207,31 @@ public class swiftApi {
2207 } 2207 }
2208 } 2208 }
2209 2209
2210 +
2211 + public func openCouponset(_ controller: UIViewController) -> Void {
2212 + for campaign in GlobalVariables.campaigns {
2213 + if (campaign._campaign_type == "coupon") {
2214 + let couponsetUuid = campaign._couponset
2215 +
2216 + if (couponsetUuid != "") {
2217 + let couponsetsList = swiftApi().getCouponSetList()
2218 +
2219 + for item in couponsetsList {
2220 + if (item.uuid == couponsetUuid) {
2221 + let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
2222 + let vc = storyboard.instantiateViewController(withIdentifier: "CouponViewController") as! SwiftWarplyFramework.CouponViewController
2223 + vc.couponset = item
2224 + controller.navigationController?.pushViewController(vc, animated: true)
2225 +
2226 + break;
2227 + }
2228 + }
2229 + }
2230 +
2231 + }
2232 + }
2233 + }
2234 +
2210 public func setCampaignList(_ campaigns: Array<CampaignItemModel>) -> Void { 2235 public func setCampaignList(_ campaigns: Array<CampaignItemModel>) -> Void {
2211 // let userTag = self.getUserTag() 2236 // let userTag = self.getUserTag()
2212 // var campaignsArray:Array<CampaignItemModel> = [] 2237 // var campaignsArray:Array<CampaignItemModel> = []
......