diff --git a/SwiftWarplyFramework/SwiftWarplyFramework/MarketPassViewController.swift b/SwiftWarplyFramework/SwiftWarplyFramework/MarketPassViewController.swift index aa5781d..18824dc 100644 --- a/SwiftWarplyFramework/SwiftWarplyFramework/MarketPassViewController.swift +++ b/SwiftWarplyFramework/SwiftWarplyFramework/MarketPassViewController.swift @@ -126,10 +126,32 @@ import SwiftEventBus // couponsValueAttributedString.append(couponsValueBoldString) // couponsValueLabel.attributedText = couponsValueAttributedString - couponsValueLabel.text = "Χρησιμοποίησε τη SUPERMARKET DEALS CARD σου για να κερδίσεις έκπτωση σε επιλεγμένα προϊόντα. Ανακάλυψε τα διαθέσιμα εκπτωτικά κουπόνια στο For You." + // ====== + + // couponsValueLabel.text = "Χρησιμοποίησε τη SUPERMARKET DEALS CARD σου για να κερδίσεις έκπτωση σε επιλεγμένα προϊόντα. Ανακάλυψε τα διαθέσιμα εκπτωτικά κουπόνια στο For You." + // couponsValueLabel.textAlignment = .left + // couponsValueLabel.font = UIFont(name: "PeridotPE-Regular", size: 13.0) + // couponsValueLabel.textColor = .white + + // ====== + + let attrRegular = [NSAttributedString.Key.font : UIFont(name: "PeridotPE-Regular", size: 13) ?? UIFont.systemFont(ofSize: 12), NSAttributedString.Key.foregroundColor: UIColor.white] + let attrBold = [NSAttributedString.Key.font : UIFont(name: "PeridotPE-SBold", size: 13) ?? UIFont.boldSystemFont(ofSize: 12), NSAttributedString.Key.foregroundColor: UIColor.white, NSAttributedString.Key.underlineStyle: NSUnderlineStyle.single.rawValue] as [NSAttributedString.Key : Any] + + let couponsValueNormalText1 = "Χρησιμοποίησε τη SUPERMARKET DEALS CARD σου και κέρδισε έκπτωση σε επιλεγμένα προϊόντα. Ανακάλυψε τα προϊόντα με εκπτωτικό κουπόνι στο " + let couponsValueBoldText = "For You" + let couponsValueNormalText2 = "." + + let couponsValueAttributedString = NSMutableAttributedString(string:couponsValueNormalText1, attributes:attrRegular) + let couponsValueBoldString = NSMutableAttributedString(string: couponsValueBoldText, attributes:attrBold) + let couponsValueNormalString2 = NSMutableAttributedString(string: couponsValueNormalText2, attributes:attrRegular) + + couponsValueAttributedString.append(couponsValueBoldString) + couponsValueAttributedString.append(couponsValueNormalString2) + couponsValueLabel.attributedText = couponsValueAttributedString couponsValueLabel.textAlignment = .left - couponsValueLabel.font = UIFont(name: "PeridotPE-Regular", size: 13.0) - couponsValueLabel.textColor = .white + + // ====== mapButton.titleLabel?.font = UIFont(name: "PeridotPE-SBold", size: 16) mapButton.setTitle("Δες στο χάρτη", for: .normal) @@ -238,10 +260,32 @@ import SwiftEventBus couponsValueAttributedString.append(couponsValueBoldString) couponsValueLabel.attributedText = couponsValueAttributedString - couponsValueLabel.text = "Χρησιμοποίησε τη SUPERMARKET DEALS CARD σου για να κερδίσεις έκπτωση σε επιλεγμένα προϊόντα. Ανακάλυψε τα διαθέσιμα εκπτωτικά κουπόνια στο For You." + // ====== + + // couponsValueLabel.text = "Χρησιμοποίησε τη SUPERMARKET DEALS CARD σου για να κερδίσεις έκπτωση σε επιλεγμένα προϊόντα. Ανακάλυψε τα διαθέσιμα εκπτωτικά κουπόνια στο For You." + // couponsValueLabel.textAlignment = .left + // couponsValueLabel.font = UIFont(name: "PeridotPE-Regular", size: 13.0) + // couponsValueLabel.textColor = .white + + // ====== + + let attrRegular = [NSAttributedString.Key.font : UIFont(name: "PeridotPE-Regular", size: 13) ?? UIFont.systemFont(ofSize: 12), NSAttributedString.Key.foregroundColor: UIColor.white] + let attrBold = [NSAttributedString.Key.font : UIFont(name: "PeridotPE-SBold", size: 13) ?? UIFont.boldSystemFont(ofSize: 12), NSAttributedString.Key.foregroundColor: UIColor.white, NSAttributedString.Key.underlineStyle: NSUnderlineStyle.single.rawValue] as [NSAttributedString.Key : Any] + + let couponsValueNormalText1 = "Χρησιμοποίησε τη SUPERMARKET DEALS CARD σου και κέρδισε έκπτωση σε επιλεγμένα προϊόντα. Ανακάλυψε τα προϊόντα με εκπτωτικό κουπόνι στο " + let couponsValueBoldText = "For You" + let couponsValueNormalText2 = "." + + let couponsValueAttributedString = NSMutableAttributedString(string:couponsValueNormalText1, attributes:attrRegular) + let couponsValueBoldString = NSMutableAttributedString(string: couponsValueBoldText, attributes:attrBold) + let couponsValueNormalString2 = NSMutableAttributedString(string: couponsValueNormalText2, attributes:attrRegular) + + couponsValueAttributedString.append(couponsValueBoldString) + couponsValueAttributedString.append(couponsValueNormalString2) + couponsValueLabel.attributedText = couponsValueAttributedString couponsValueLabel.textAlignment = .left - couponsValueLabel.font = UIFont(name: "PeridotPE-Regular", size: 13.0) - couponsValueLabel.textColor = .white + + // ====== // let formattedCost = couponsValueString.replacingOccurrences(of: ".", with: ",") // couponsValueLabel.isAccessibilityElement = true