Showing
5 changed files
with
9 additions
and
2 deletions
| ... | @@ -176,6 +176,8 @@ var timer2: DispatchSourceTimer? | ... | @@ -176,6 +176,8 @@ var timer2: DispatchSourceTimer? |
| 176 | if (couponsData != nil) { | 176 | if (couponsData != nil) { |
| 177 | 177 | ||
| 178 | DispatchQueue.main.async { | 178 | DispatchQueue.main.async { |
| 179 | + SwiftEventBus.post("coupons_fetched") | ||
| 180 | + | ||
| 179 | print("========= getCouponsRequest SUCCESSSS CampaignVC =========") | 181 | print("========= getCouponsRequest SUCCESSSS CampaignVC =========") |
| 180 | 182 | ||
| 181 | print("========= getCouponsRequest count CampaignVC =========") | 183 | print("========= getCouponsRequest count CampaignVC =========") | ... | ... |
| ... | @@ -6,7 +6,7 @@ | ... | @@ -6,7 +6,7 @@ |
| 6 | // | 6 | // |
| 7 | 7 | ||
| 8 | import UIKit | 8 | import UIKit |
| 9 | -// import SwiftEventBus | 9 | +import SwiftEventBus |
| 10 | 10 | ||
| 11 | @objc public class CouponViewController: UIViewController { | 11 | @objc public class CouponViewController: UIViewController { |
| 12 | @IBOutlet weak var mainView: UIView! | 12 | @IBOutlet weak var mainView: UIView! |
| ... | @@ -144,6 +144,7 @@ import UIKit | ... | @@ -144,6 +144,7 @@ import UIKit |
| 144 | if (couponsData != nil) { | 144 | if (couponsData != nil) { |
| 145 | 145 | ||
| 146 | DispatchQueue.main.async { | 146 | DispatchQueue.main.async { |
| 147 | + SwiftEventBus.post("coupons_fetched") | ||
| 147 | } | 148 | } |
| 148 | } else { | 149 | } else { |
| 149 | } | 150 | } | ... | ... |
| ... | @@ -57,6 +57,7 @@ import SwiftEventBus | ... | @@ -57,6 +57,7 @@ import SwiftEventBus |
| 57 | self.coupons = activeCouponData | 57 | self.coupons = activeCouponData |
| 58 | 58 | ||
| 59 | DispatchQueue.main.async { | 59 | DispatchQueue.main.async { |
| 60 | + SwiftEventBus.post("coupons_fetched") | ||
| 60 | self.tableView.reloadData() | 61 | self.tableView.reloadData() |
| 61 | } | 62 | } |
| 62 | } else { | 63 | } else { | ... | ... |
| ... | @@ -6,6 +6,7 @@ | ... | @@ -6,6 +6,7 @@ |
| 6 | // | 6 | // |
| 7 | 7 | ||
| 8 | import UIKit | 8 | import UIKit |
| 9 | +import SwiftEventBus | ||
| 9 | 10 | ||
| 10 | @objc public class ShareViewController: UIViewController, UITextFieldDelegate, UIPopoverControllerDelegate { | 11 | @objc public class ShareViewController: UIViewController, UITextFieldDelegate, UIPopoverControllerDelegate { |
| 11 | @IBOutlet weak var mainView: UIView! | 12 | @IBOutlet weak var mainView: UIView! |
| ... | @@ -220,6 +221,7 @@ import UIKit | ... | @@ -220,6 +221,7 @@ import UIKit |
| 220 | if (couponsData != nil) { | 221 | if (couponsData != nil) { |
| 221 | 222 | ||
| 222 | DispatchQueue.main.async { | 223 | DispatchQueue.main.async { |
| 224 | + SwiftEventBus.post("coupons_fetched") | ||
| 223 | self.showSuccessDialog("Συγχαρητήρια!","Μόλις έκανες δώρο ένα κουπόνι!") | 225 | self.showSuccessDialog("Συγχαρητήρια!","Μόλις έκανες δώρο ένα κουπόνι!") |
| 224 | } | 226 | } |
| 225 | } else { | 227 | } else { | ... | ... |
| ... | @@ -619,7 +619,7 @@ public class swiftApi { | ... | @@ -619,7 +619,7 @@ public class swiftApi { |
| 619 | swiftApi().setCouponList(tempCoupons) | 619 | swiftApi().setCouponList(tempCoupons) |
| 620 | swiftApi().setOldCouponList(tempCoupons) | 620 | swiftApi().setOldCouponList(tempCoupons) |
| 621 | 621 | ||
| 622 | - SwiftEventBus.post("coupons_fetched") | 622 | + // SwiftEventBus.post("coupons_fetched") |
| 623 | 623 | ||
| 624 | let activeCoupons = tempCoupons.filter({ return $0.status == 1 }) | 624 | let activeCoupons = tempCoupons.filter({ return $0.status == 1 }) |
| 625 | getCouponsCallback(activeCoupons) | 625 | getCouponsCallback(activeCoupons) |
| ... | @@ -2968,6 +2968,7 @@ public class swiftApi { | ... | @@ -2968,6 +2968,7 @@ public class swiftApi { |
| 2968 | func getCouponsCallback (_ couponsData: Array<swiftApi.CouponItemModel>?) -> Void { | 2968 | func getCouponsCallback (_ couponsData: Array<swiftApi.CouponItemModel>?) -> Void { |
| 2969 | if (couponsData != nil) { | 2969 | if (couponsData != nil) { |
| 2970 | DispatchQueue.main.async { | 2970 | DispatchQueue.main.async { |
| 2971 | + SwiftEventBus.post("coupons_fetched") | ||
| 2971 | } | 2972 | } |
| 2972 | } else { | 2973 | } else { |
| 2973 | } | 2974 | } | ... | ... |
-
Please register or login to post a comment