Showing
2 changed files
with
29 additions
and
1 deletions
... | @@ -57,4 +57,17 @@ import UIKit | ... | @@ -57,4 +57,17 @@ import UIKit |
57 | } | 57 | } |
58 | } | 58 | } |
59 | 59 | ||
60 | + func configureCell(ccms: swiftApi.LoyaltyContextualOfferModel) { | ||
61 | + campaignImage.load(link: ccms._imageUrl , placeholder: UIImage(), cache: URLCache()) | ||
62 | + | ||
63 | + campaignTitleLabel.text = ccms._title | ||
64 | + campaignTitleLabel.font = UIFont(name: "PFSquareSansPro-BoldItalic", size: 18) | ||
65 | + subtitleLabel.text = ccms._subtitle | ||
66 | + subtitleLabel.font = UIFont(name: "PFSquareSansPro-Regular", size: 16) | ||
67 | + descriptionLabel.text = ccms._description | ||
68 | + descriptionLabel.font = UIFont(name: "PFSquareSansPro-Bold", size: 14) | ||
69 | + | ||
70 | + newBadgeImage.isHidden = true | ||
71 | + } | ||
72 | + | ||
60 | } | 73 | } | ... | ... |
... | @@ -73,7 +73,22 @@ extension MFYViewController: UITableViewDelegate, UITableViewDataSource{ | ... | @@ -73,7 +73,22 @@ extension MFYViewController: UITableViewDelegate, UITableViewDataSource{ |
73 | public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | 73 | public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { |
74 | let cell = tableView.dequeueReusableCell(withIdentifier: "MFYInboxTableViewCellId", for: indexPath) as! MFYInboxTableViewCell | 74 | let cell = tableView.dequeueReusableCell(withIdentifier: "MFYInboxTableViewCellId", for: indexPath) as! MFYInboxTableViewCell |
75 | 75 | ||
76 | - cell.configureCell(campaign: campaigns[indexPath.row]) | 76 | + if (campaigns[indexPath.row]._type != nil && campaigns[indexPath.row]._type == "telco") { |
77 | + let ccmsCampaigns = swiftApi().getCCMSLoyaltyCampaigns() | ||
78 | + let loyaltyCampaignIdExists = ccmsCampaigns.contains { $0._loyaltyCampaignId == campaigns[indexPath.row].session_uuid } | ||
79 | + | ||
80 | + if (loyaltyCampaignIdExists == true) { | ||
81 | + for item in ccmsCampaigns { | ||
82 | + if (item._loyaltyCampaignId == campaigns[indexPath.row].session_uuid) { | ||
83 | + cell.configureCell(ccms: item) | ||
84 | + break; | ||
85 | + } | ||
86 | + } | ||
87 | + } | ||
88 | + | ||
89 | + } else { | ||
90 | + cell.configureCell(campaign: campaigns[indexPath.row]) | ||
91 | + } | ||
77 | 92 | ||
78 | return cell | 93 | return cell |
79 | } | 94 | } | ... | ... |
-
Please register or login to post a comment