Manos Chorianopoulos

dynamic CouponViewController

......@@ -7,7 +7,7 @@
<key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>1</integer>
</dict>
</dict>
</dict>
......
......@@ -7,7 +7,7 @@
<key>SwiftWarplyFramework.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>0</integer>
</dict>
</dict>
</dict>
......
......@@ -13,7 +13,10 @@ import UIKit
@IBOutlet weak var backgroundImage: UIImageView!
@IBOutlet weak var scrollView: UIScrollView!
@IBOutlet weak var scrollContentView: UIView!
@IBOutlet weak var couponImage: UIImageView!
@IBOutlet weak var couponImageHeight: NSLayoutConstraint!
@IBOutlet weak var nameLabel: UILabel!
@IBOutlet weak var descriptionLabel: UILabel!
@IBOutlet weak var redeemButton: UIButton!
@IBOutlet weak var termsButton: UIButton!
@IBOutlet weak var termsTextView: UITextView!
......@@ -22,6 +25,8 @@ import UIKit
let uiscreen: CGRect = UIScreen.main.bounds
var termsVisible: Bool = false;
public var couponset: swiftApi.CouponSetItemModel?
public override func viewDidLoad() {
super.viewDidLoad()
......@@ -36,14 +41,19 @@ import UIKit
scrollView.layer.cornerRadius = 30
scrollView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
couponImage.load(link: couponset?.img_preview ?? "", placeholder: UIImage(), cache: URLCache())
couponImage.contentMode = .scaleAspectFill
couponImageHeight.constant = self.uiscreen.height * 0.25
nameLabel.text = couponset?.name ?? ""
descriptionLabel.text = couponset?.short_description ?? ""
redeemButton.titleLabel?.font = UIFont.systemFont(ofSize: 15, weight: .medium)
termsButton.titleLabel?.font = .systemFont(ofSize: 15.0, weight: .semibold)
// termsButton.imageView?.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5)
let htmlText = "<p>Το κουπόνι ισχύει έως 05/12/2022</p>\n"
let htmlText = couponset?.terms ?? ""
termsTextView.attributedText = htmlText.htmlToAttributedString
termsTextView.font = UIFont.systemFont(ofSize: 14, weight: UIFont.Weight.regular)
termsTextView.textColor = UIColor(red: 0.25, green: 0.33, blue: 0.39, alpha: 1.00)
......
......@@ -730,8 +730,11 @@
</view>
<connections>
<outlet property="backgroundImage" destination="Oep-XD-blB" id="YaT-qr-rry"/>
<outlet property="couponImage" destination="3SX-fR-ph2" id="Ov2-Bw-eWL"/>
<outlet property="couponImageHeight" destination="zUx-Yd-in7" id="7vo-8L-d8o"/>
<outlet property="descriptionLabel" destination="dSA-lM-N5v" id="v6k-3l-uaA"/>
<outlet property="mainView" destination="Jqu-cp-CWU" id="Q0Z-dO-MXL"/>
<outlet property="nameLabel" destination="isU-Qv-94G" id="Vc8-gh-Cth"/>
<outlet property="redeemButton" destination="FCd-hv-dHg" id="3Jw-Yn-uNr"/>
<outlet property="scrollContentView" destination="uTN-Qr-wBi" id="pPq-Lh-qVN"/>
<outlet property="scrollView" destination="1N5-oA-ZTb" id="qee-AV-Oev"/>
......