Showing
3 changed files
with
43 additions
and
2 deletions
No preview for this file type
| ... | @@ -206,3 +206,9 @@ extension UIViewController | ... | @@ -206,3 +206,9 @@ extension UIViewController |
| 206 | view.endEditing(true) | 206 | view.endEditing(true) |
| 207 | } | 207 | } |
| 208 | } | 208 | } |
| 209 | + | ||
| 210 | +extension UIFont { | ||
| 211 | + class func mediumSystemFont(ofSize pointSize: CGFloat) -> UIFont { | ||
| 212 | + return self.systemFont(ofSize: pointSize, weight: .medium) | ||
| 213 | + } | ||
| 214 | +} | ... | ... |
| ... | @@ -126,7 +126,23 @@ import SwiftEventBus | ... | @@ -126,7 +126,23 @@ import SwiftEventBus |
| 126 | var totalCouponValueString = "0" | 126 | var totalCouponValueString = "0" |
| 127 | totalCouponValueString = String(format: "%.2f", totalCouponValue).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil) | 127 | totalCouponValueString = String(format: "%.2f", totalCouponValue).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil) |
| 128 | 128 | ||
| 129 | - dfyEarnLabel.text = "Μέχρι τώρα έχεις κερδίσει " + totalCouponValueString + "€ με το DEALS for YOU!" | 129 | + // dfyEarnLabel.text = "Μέχρι τώρα έχεις κερδίσει " + totalCouponValueString + "€ με το DEALS for YOU!" |
| 130 | + | ||
| 131 | + let normalText1 = "Μέχρι τώρα έχεις κερδίσει " | ||
| 132 | + let boldText = totalCouponValueString + "€" | ||
| 133 | + let normalText2 = " με το DEALS for YOU!" | ||
| 134 | + | ||
| 135 | + let attrRegular = [NSAttributedString.Key.font : UIFont.systemFont(ofSize: 16)] | ||
| 136 | + let attrBold = [NSAttributedString.Key.font : UIFont.boldSystemFont(ofSize: 16)] | ||
| 137 | + | ||
| 138 | + let attributedString = NSMutableAttributedString(string:normalText1, attributes:attrRegular) | ||
| 139 | + let boldString = NSMutableAttributedString(string: boldText, attributes:attrBold) | ||
| 140 | + let normalString = NSMutableAttributedString(string:normalText2, attributes:attrRegular) | ||
| 141 | + | ||
| 142 | + attributedString.append(boldString) | ||
| 143 | + attributedString.append(normalString) | ||
| 144 | + dfyEarnLabel.attributedText = attributedString | ||
| 145 | + | ||
| 130 | dfyEarnAmountLabel.text = totalCouponValueString + "€" | 146 | dfyEarnAmountLabel.text = totalCouponValueString + "€" |
| 131 | 147 | ||
| 132 | if (loyaltyBadge._couponCount == 0) { | 148 | if (loyaltyBadge._couponCount == 0) { |
| ... | @@ -149,7 +165,26 @@ import SwiftEventBus | ... | @@ -149,7 +165,26 @@ import SwiftEventBus |
| 149 | var totalCouponDiscountString = "0" | 165 | var totalCouponDiscountString = "0" |
| 150 | totalCouponDiscountString = String(format: "%.2f", totalCouponDiscount).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil) | 166 | totalCouponDiscountString = String(format: "%.2f", totalCouponDiscount).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil) |
| 151 | 167 | ||
| 152 | - couponEarnLabel.text = "Μέχρι τώρα έχεις κερδίσει " + totalCouponDiscountString + "€ σε προσφορές από " + String(loyaltyBadge._couponCount) + " κουπόνια!" | 168 | + // couponEarnLabel.text = "Μέχρι τώρα έχεις κερδίσει " + totalCouponDiscountString + "€ σε προσφορές από " + String(loyaltyBadge._couponCount) + " κουπόνια!" |
| 169 | + | ||
| 170 | + let coupNormalText1 = "Μέχρι τώρα έχεις κερδίσει " | ||
| 171 | + let coupBoldText = totalCouponDiscountString + "€" | ||
| 172 | + let coupNormalText2 = " σε προσφορές από " | ||
| 173 | + let coupBoldText2 = String(loyaltyBadge._couponCount) | ||
| 174 | + let coupNormalText3 = " κουπόνια!" | ||
| 175 | + | ||
| 176 | + let coupAttributedString = NSMutableAttributedString(string:coupNormalText1, attributes:attrRegular) | ||
| 177 | + let coupBoldString = NSMutableAttributedString(string: coupBoldText, attributes:attrBold) | ||
| 178 | + let coupNormalString2 = NSMutableAttributedString(string:coupNormalText2, attributes:attrRegular) | ||
| 179 | + let coupBoldString2 = NSMutableAttributedString(string: coupBoldText2, attributes:attrBold) | ||
| 180 | + let coupNormalString3 = NSMutableAttributedString(string:coupNormalText3, attributes:attrRegular) | ||
| 181 | + | ||
| 182 | + coupAttributedString.append(coupBoldString) | ||
| 183 | + coupAttributedString.append(coupNormalString2) | ||
| 184 | + coupAttributedString.append(coupBoldString2) | ||
| 185 | + coupAttributedString.append(coupNormalString3) | ||
| 186 | + couponEarnLabel.attributedText = attributedString | ||
| 187 | + | ||
| 153 | couponEarnAmountLabel.text = totalCouponDiscountString + "€" | 188 | couponEarnAmountLabel.text = totalCouponDiscountString + "€" |
| 154 | 189 | ||
| 155 | print("Loyalty Badge Value: " + totalCouponDiscountString) | 190 | print("Loyalty Badge Value: " + totalCouponDiscountString) | ... | ... |
-
Please register or login to post a comment