Manos Chorianopoulos

fix telco banners at GFYVC

......@@ -125,7 +125,22 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{
public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "InboxTableViewCellId", for: indexPath) as! InboxTableViewCell
if (campaigns[indexPath.row]._type != nil && campaigns[indexPath.row]._type == "telco") {
let ccmsCampaigns = swiftApi().getCCMSLoyaltyCampaigns()
let loyaltyCampaignIdExists = ccmsCampaigns.contains { $0._loyaltyCampaignId == campaigns[indexPath.row].session_uuid }
if (loyaltyCampaignIdExists == true) {
for item in ccmsCampaigns {
if (item._loyaltyCampaignId == campaigns[indexPath.row].session_uuid) {
cell.configureCell(ccms: item)
break;
}
}
}
} else {
cell.configureCell(campaign: campaigns[indexPath.row])
}
return cell
}
......
......@@ -52,4 +52,12 @@ import UIKit
}
}
func configureCell(ccms: swiftApi.LoyaltyContextualOfferModel) {
campaignImage.load(link: ccms._imageUrl , placeholder: UIImage(), cache: URLCache())
campaignTitleLabel.text = ccms._title
newBadgeImage.isHidden = true
}
}
......