Manos Chorianopoulos

fix banner texts at WalletVC

......@@ -206,3 +206,9 @@ extension UIViewController
view.endEditing(true)
}
}
extension UIFont {
class func mediumSystemFont(ofSize pointSize: CGFloat) -> UIFont {
return self.systemFont(ofSize: pointSize, weight: .medium)
}
}
......
......@@ -126,7 +126,23 @@ import SwiftEventBus
var totalCouponValueString = "0"
totalCouponValueString = String(format: "%.2f", totalCouponValue).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil)
dfyEarnLabel.text = "Μέχρι τώρα έχεις κερδίσει " + totalCouponValueString + "€ με το DEALS for YOU!"
// dfyEarnLabel.text = "Μέχρι τώρα έχεις κερδίσει " + totalCouponValueString + "€ με το DEALS for YOU!"
let normalText1 = "Μέχρι τώρα έχεις κερδίσει "
let boldText = totalCouponValueString + "€"
let normalText2 = " με το DEALS for YOU!"
let attrRegular = [NSAttributedString.Key.font : UIFont.systemFont(ofSize: 16)]
let attrBold = [NSAttributedString.Key.font : UIFont.boldSystemFont(ofSize: 16)]
let attributedString = NSMutableAttributedString(string:normalText1, attributes:attrRegular)
let boldString = NSMutableAttributedString(string: boldText, attributes:attrBold)
let normalString = NSMutableAttributedString(string:normalText2, attributes:attrRegular)
attributedString.append(boldString)
attributedString.append(normalString)
dfyEarnLabel.attributedText = attributedString
dfyEarnAmountLabel.text = totalCouponValueString + "€"
if (loyaltyBadge._couponCount == 0) {
......@@ -149,7 +165,26 @@ import SwiftEventBus
var totalCouponDiscountString = "0"
totalCouponDiscountString = String(format: "%.2f", totalCouponDiscount).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil)
couponEarnLabel.text = "Μέχρι τώρα έχεις κερδίσει " + totalCouponDiscountString + "€ σε προσφορές από " + String(loyaltyBadge._couponCount) + " κουπόνια!"
// couponEarnLabel.text = "Μέχρι τώρα έχεις κερδίσει " + totalCouponDiscountString + "€ σε προσφορές από " + String(loyaltyBadge._couponCount) + " κουπόνια!"
let coupNormalText1 = "Μέχρι τώρα έχεις κερδίσει "
let coupBoldText = totalCouponDiscountString + "€"
let coupNormalText2 = " σε προσφορές από "
let coupBoldText2 = String(loyaltyBadge._couponCount)
let coupNormalText3 = " κουπόνια!"
let coupAttributedString = NSMutableAttributedString(string:coupNormalText1, attributes:attrRegular)
let coupBoldString = NSMutableAttributedString(string: coupBoldText, attributes:attrBold)
let coupNormalString2 = NSMutableAttributedString(string:coupNormalText2, attributes:attrRegular)
let coupBoldString2 = NSMutableAttributedString(string: coupBoldText2, attributes:attrBold)
let coupNormalString3 = NSMutableAttributedString(string:coupNormalText3, attributes:attrRegular)
coupAttributedString.append(coupBoldString)
coupAttributedString.append(coupNormalString2)
coupAttributedString.append(coupBoldString2)
coupAttributedString.append(coupNormalString3)
couponEarnLabel.attributedText = attributedString
couponEarnAmountLabel.text = totalCouponDiscountString + "€"
print("Loyalty Badge Value: " + totalCouponDiscountString)
......