Manos Chorianopoulos

nonTelco popup in couponVC

......@@ -22,6 +22,8 @@ import UIKit
@IBOutlet weak var termsTextView: UITextView!
@IBOutlet weak var termsTextViewHeight: NSLayoutConstraint!
public var profile:swiftApi.ProfileModel? = swiftApi().getConsumer()
let uiscreen: CGRect = UIScreen.main.bounds
var termsVisible: Bool = false;
......@@ -38,6 +40,10 @@ import UIKit
setBackButton()
setNavigationTitle("Εκπτωτικό κουπόνι")
if ((profile != nil) && (profile?._nonTelco == true)) {
nonTelcoDialog("", "Παρακαλούμε πολύ πρόσθεσε τις συνδέσεις σου στην COSMOTE για να έχεις πρόσβαση στα προνόμια του νέου Loyalty προγράμματος της COSMOTE!");
}
backgroundImage.image = UIImage(named: "coupons_scrollview_white", in: Bundle(for: MyEmptyClass.self), compatibleWith: nil)
scrollView.clipsToBounds = true
......@@ -80,6 +86,26 @@ import UIKit
}
// MARK: - Functions
func nonTelcoDialog(_ alertTitle: String, _ alertSubTitle: String) -> Void {
let alert = UIAlertController(title: alertTitle, message: alertSubTitle, preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in
switch action.style{
case .default:
self.navigationController?.popViewController(animated: true)
self.dismiss(animated: true, completion: {})
case .cancel:
print("cancel")
case .destructive:
print("destructive")
}
}))
self.present(alert, animated: true, completion: nil)
}
func toggleTerms() {
if (termsVisible) {
termsTextView.isHidden = false
......