Manos Chorianopoulos

fix telco banner at MFYVC

......@@ -57,4 +57,17 @@ import UIKit
}
}
func configureCell(ccms: swiftApi.LoyaltyContextualOfferModel) {
campaignImage.load(link: ccms._imageUrl , placeholder: UIImage(), cache: URLCache())
campaignTitleLabel.text = ccms._title
campaignTitleLabel.font = UIFont(name: "PFSquareSansPro-BoldItalic", size: 18)
subtitleLabel.text = ccms._subtitle
subtitleLabel.font = UIFont(name: "PFSquareSansPro-Regular", size: 16)
descriptionLabel.text = ccms._description
descriptionLabel.font = UIFont(name: "PFSquareSansPro-Bold", size: 14)
newBadgeImage.isHidden = true
}
}
......
......@@ -73,7 +73,22 @@ extension MFYViewController: UITableViewDelegate, UITableViewDataSource{
public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "MFYInboxTableViewCellId", for: indexPath) as! MFYInboxTableViewCell
cell.configureCell(campaign: campaigns[indexPath.row])
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
}
......