Skip to content

Commit a427e4a

Browse files
Update: title label to match the design
1 parent 79e18e8 commit a427e4a

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

WordPress/Classes/ViewRelated/Jetpack/Branding/Overlay/JetpackFullscreenOverlayViewController.swift

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class JetpackFullscreenOverlayViewController: UIViewController {
115115

116116
private func setupContent() {
117117
animationView.animation = animation
118-
titleLabel.text = config.title
118+
setTitle()
119119
subtitleLabel.text = config.subtitle
120120
footnoteLabel.text = config.footnote
121121
switchButton.setTitle(config.switchButtonText, for: .normal)
@@ -126,6 +126,20 @@ class JetpackFullscreenOverlayViewController: UIViewController {
126126
setupLearnMoreButton()
127127
}
128128

129+
private func setTitle() {
130+
let style = NSMutableParagraphStyle()
131+
style.lineHeightMultiple = Metrics.titleLineHeightMultiple
132+
style.lineBreakMode = .byTruncatingTail
133+
134+
let defaultAttributes: [NSAttributedString.Key: Any] = [
135+
.paragraphStyle: style,
136+
.kern: Metrics.titleKern
137+
]
138+
let attributedString = NSMutableAttributedString(string: config.title)
139+
attributedString.addAttributes(defaultAttributes, range: NSRange(location: 0, length: attributedString.length))
140+
titleLabel.attributedText = attributedString
141+
}
142+
129143
private func setupColors() {
130144
view.backgroundColor = Colors.backgroundColor
131145
footnoteLabel.textColor = Colors.footnoteTextColor
@@ -229,6 +243,8 @@ private extension JetpackFullscreenOverlayViewController {
229243
static let externalIconSize = CGSize(width: 16, height: 16)
230244
static let externalIconBounds = CGRect(x: 0, y: -2, width: 16, height: 16)
231245
static let switchButtonCornerRadius: CGFloat = 6
246+
static let titleLineHeightMultiple: CGFloat = 0.88
247+
static let titleKern: CGFloat = 0.37
232248
}
233249

234250
enum Constants {

0 commit comments

Comments
 (0)