Manos Chorianopoulos

fix telco banners at GFYVC

...@@ -125,7 +125,22 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{ ...@@ -125,7 +125,22 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{
125 public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 125 public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
126 let cell = tableView.dequeueReusableCell(withIdentifier: "InboxTableViewCellId", for: indexPath) as! InboxTableViewCell 126 let cell = tableView.dequeueReusableCell(withIdentifier: "InboxTableViewCellId", for: indexPath) as! InboxTableViewCell
127 127
128 + if (campaigns[indexPath.row]._type != nil && campaigns[indexPath.row]._type == "telco") {
129 + let ccmsCampaigns = swiftApi().getCCMSLoyaltyCampaigns()
130 + let loyaltyCampaignIdExists = ccmsCampaigns.contains { $0._loyaltyCampaignId == campaigns[indexPath.row].session_uuid }
131 +
132 + if (loyaltyCampaignIdExists == true) {
133 + for item in ccmsCampaigns {
134 + if (item._loyaltyCampaignId == campaigns[indexPath.row].session_uuid) {
135 + cell.configureCell(ccms: item)
136 + break;
137 + }
138 + }
139 + }
140 +
141 + } else {
128 cell.configureCell(campaign: campaigns[indexPath.row]) 142 cell.configureCell(campaign: campaigns[indexPath.row])
143 + }
129 144
130 return cell 145 return cell
131 } 146 }
......
...@@ -52,4 +52,12 @@ import UIKit ...@@ -52,4 +52,12 @@ import UIKit
52 } 52 }
53 } 53 }
54 54
55 + func configureCell(ccms: swiftApi.LoyaltyContextualOfferModel) {
56 + campaignImage.load(link: ccms._imageUrl , placeholder: UIImage(), cache: URLCache())
57 +
58 + campaignTitleLabel.text = ccms._title
59 +
60 + newBadgeImage.isHidden = true
61 + }
62 +
55 } 63 }
......