Commit 17daef8a by Demid Merzlyakov

NWSAlertCell: (semi)bold highlight.

parent b2a14a06
......@@ -74,7 +74,18 @@ class NWSAlertCell: UITableViewCell {
}
headerActiveExpiredLabel.isHidden = false
let expiryString = expiryDateFormatter(timeZone: alert.timeZone).string(from: alert.expires)
alertTextLabel.text = "\(alert.description) \("notifications.nwsCell.remainsInEffectUntil".localized()) \(expiryString)"
let attributedText = NSMutableAttributedString(string: "\(alert.description) \("notifications.nwsCell.remainsInEffectUntil".localized()) \(expiryString)",
attributes: [
.font: AppFont.SFPro.regular(size: 14),
.foregroundColor: primaryTextColor as Any
])
let nsText = attributedText.string as NSString
let boldRange = nsText.range(of: alert.description)
if boldRange.location != NSNotFound {
attributedText.addAttribute(.font, value: AppFont.SFPro.semibold(size: 14), range: boldRange)
}
alertTextLabel.attributedText = attributedText
if let issueDate = alert.extendedInfo?.issueDate {
let issueDateString = issueDateFormatter(timeZone: alert.timeZone).string(from: issueDate)
......@@ -87,7 +98,7 @@ class NWSAlertCell: UITableViewCell {
}
private extension NWSAlertCell {
var primaryTextColor: UIColor? {
var primaryTextColor: UIColor! {
UIColor(named: "notifications_primary_text")
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment