Manos Chorianopoulos

possible fix for disappearing campaigns on back

...@@ -13,7 +13,13 @@ import SwiftEventBus ...@@ -13,7 +13,13 @@ import SwiftEventBus
13 @IBOutlet weak var mainView: UIView! 13 @IBOutlet weak var mainView: UIView!
14 @IBOutlet weak var tableView: UITableView! 14 @IBOutlet weak var tableView: UITableView!
15 15
16 - public var campaigns:Array<swiftApi.CampaignItemModel> = [] 16 + public var campaigns:Array<swiftApi.CampaignItemModel> = [] {
17 + didSet {
18 + DispatchQueue.main.async {
19 + self.tableView.reloadData()
20 + }
21 + }
22 + }
17 public var seasonalList:Array<swiftApi.LoyaltyGiftsForYouPackage> = swiftApi().getSeasonalList() 23 public var seasonalList:Array<swiftApi.LoyaltyGiftsForYouPackage> = swiftApi().getSeasonalList()
18 public var ccmsList:Array<swiftApi.LoyaltyContextualOfferModel> = swiftApi().getCCMSLoyaltyCampaigns() 24 public var ccmsList:Array<swiftApi.LoyaltyContextualOfferModel> = swiftApi().getCCMSLoyaltyCampaigns()
19 public var loyaltyList:Array<swiftApi.CampaignItemModel> = swiftApi().mergeGFYCCMSLoyaltyCampaigns(campaigns: swiftApi().getCCMSLoyaltyCampaigns()) 25 public var loyaltyList:Array<swiftApi.CampaignItemModel> = swiftApi().mergeGFYCCMSLoyaltyCampaigns(campaigns: swiftApi().getCCMSLoyaltyCampaigns())
......
...@@ -13,7 +13,13 @@ import SwiftEventBus ...@@ -13,7 +13,13 @@ import SwiftEventBus
13 @IBOutlet weak var mainView: UIView! 13 @IBOutlet weak var mainView: UIView!
14 @IBOutlet weak var tableView: UITableView! 14 @IBOutlet weak var tableView: UITableView!
15 15
16 - var categories: Array<CampaignCategory> = [CampaignCategory]() 16 + var categories: Array<CampaignCategory> = [CampaignCategory]() {
17 + didSet {
18 + DispatchQueue.main.async {
19 + self.tableView.reloadData()
20 + }
21 + }
22 + }
17 23
18 public var campaigns:Array<swiftApi.CampaignItemModel> = [] 24 public var campaigns:Array<swiftApi.CampaignItemModel> = []
19 public var loyaltyList:Array<swiftApi.CampaignItemModel> = swiftApi().mergeMFYCCMSLoyaltyCampaigns(campaigns: swiftApi().getCCMSLoyaltyCampaigns()) 25 public var loyaltyList:Array<swiftApi.CampaignItemModel> = swiftApi().mergeMFYCCMSLoyaltyCampaigns(campaigns: swiftApi().getCCMSLoyaltyCampaigns())
......