Showing
1 changed file
with
26 additions
and
0 deletions
| ... | @@ -21,6 +21,8 @@ import UIKit | ... | @@ -21,6 +21,8 @@ import UIKit |
| 21 | @IBOutlet weak var termsButton: UIButton! | 21 | @IBOutlet weak var termsButton: UIButton! |
| 22 | @IBOutlet weak var termsTextView: UITextView! | 22 | @IBOutlet weak var termsTextView: UITextView! |
| 23 | @IBOutlet weak var termsTextViewHeight: NSLayoutConstraint! | 23 | @IBOutlet weak var termsTextViewHeight: NSLayoutConstraint! |
| 24 | + | ||
| 25 | + public var profile:swiftApi.ProfileModel? = swiftApi().getConsumer() | ||
| 24 | 26 | ||
| 25 | let uiscreen: CGRect = UIScreen.main.bounds | 27 | let uiscreen: CGRect = UIScreen.main.bounds |
| 26 | 28 | ||
| ... | @@ -37,6 +39,10 @@ import UIKit | ... | @@ -37,6 +39,10 @@ import UIKit |
| 37 | // Do any additional setup after loading the view. | 39 | // Do any additional setup after loading the view. |
| 38 | setBackButton() | 40 | setBackButton() |
| 39 | setNavigationTitle("Εκπτωτικό κουπόνι") | 41 | setNavigationTitle("Εκπτωτικό κουπόνι") |
| 42 | + | ||
| 43 | + if ((profile != nil) && (profile?._nonTelco == true)) { | ||
| 44 | + nonTelcoDialog("", "Παρακαλούμε πολύ πρόσθεσε τις συνδέσεις σου στην COSMOTE για να έχεις πρόσβαση στα προνόμια του νέου Loyalty προγράμματος της COSMOTE!"); | ||
| 45 | + } | ||
| 40 | 46 | ||
| 41 | backgroundImage.image = UIImage(named: "coupons_scrollview_white", in: Bundle(for: MyEmptyClass.self), compatibleWith: nil) | 47 | backgroundImage.image = UIImage(named: "coupons_scrollview_white", in: Bundle(for: MyEmptyClass.self), compatibleWith: nil) |
| 42 | 48 | ||
| ... | @@ -80,6 +86,26 @@ import UIKit | ... | @@ -80,6 +86,26 @@ import UIKit |
| 80 | } | 86 | } |
| 81 | 87 | ||
| 82 | // MARK: - Functions | 88 | // MARK: - Functions |
| 89 | + func nonTelcoDialog(_ alertTitle: String, _ alertSubTitle: String) -> Void { | ||
| 90 | + | ||
| 91 | + let alert = UIAlertController(title: alertTitle, message: alertSubTitle, preferredStyle: .alert) | ||
| 92 | + alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in | ||
| 93 | + switch action.style{ | ||
| 94 | + case .default: | ||
| 95 | + self.navigationController?.popViewController(animated: true) | ||
| 96 | + self.dismiss(animated: true, completion: {}) | ||
| 97 | + | ||
| 98 | + case .cancel: | ||
| 99 | + print("cancel") | ||
| 100 | + | ||
| 101 | + case .destructive: | ||
| 102 | + print("destructive") | ||
| 103 | + | ||
| 104 | + } | ||
| 105 | + })) | ||
| 106 | + self.present(alert, animated: true, completion: nil) | ||
| 107 | + } | ||
| 108 | + | ||
| 83 | func toggleTerms() { | 109 | func toggleTerms() { |
| 84 | if (termsVisible) { | 110 | if (termsVisible) { |
| 85 | termsTextView.isHidden = false | 111 | termsTextView.isHidden = false | ... | ... |
-
Please register or login to post a comment