CouponViewController.swift 1.55 KB
//
//  CouponViewController.swift
//  WarplySDKFrameworkIOS
//
//  Created by Manos Chorianopoulos on 5/5/22.
//

import UIKit

class CouponViewController: UIViewController {
    @IBOutlet weak var mainView: UIView!
    @IBOutlet weak var scrollContentView: UIView!
    @IBOutlet weak var couponImageHeight: NSLayoutConstraint!
    @IBOutlet weak var redeemButton: UIButton!
    @IBOutlet weak var termsLabel: UILabel!
    
    let uiscreen: CGRect = UIScreen.main.bounds
    
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        setBackButton()
        setNavigationTitle("Εκπτωτικό κουπόνι")
        
        mainView.clipsToBounds = true
        mainView.layer.cornerRadius = 30
        mainView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
        
        couponImageHeight.constant = self.uiscreen.height * 0.25
        
        redeemButton.titleLabel?.font = UIFont.systemFont(ofSize: 15, weight: .medium)
        
        termsLabel.font = UIFont.systemFont(ofSize: 14, weight: UIFont.Weight.medium)
        let tap = UITapGestureRecognizer(target: self, action: #selector(CouponViewController.termsTapFunction))
        termsLabel.isUserInteractionEnabled = true
        termsLabel.addGestureRecognizer(tap)
    }
    
    
    // MARK: - Actions
    
    @objc func termsTapFunction(sender:UITapGestureRecognizer) {
        print("Terms tapped!")
    }

    @IBAction func redeemButtomAction(_ sender: Any) {
        print("redeem Buttom Pressed!")
    }
}