@@ -103,6 +103,11 @@ class InfoListCell: UITableViewCell {
103
103
private static let titleFont = UIFont . systemFont ( ofSize: 18 , weight: UIFontWeightMedium)
104
104
private static let descriptionFont = UIFont . systemFont ( ofSize: 15 , weight: UIFontWeightLight)
105
105
private static let callToActionFont = UIFont . systemFont ( ofSize: 15 , weight: UIFontWeightSemibold)
106
+ private static let paragraphStyle : NSParagraphStyle = {
107
+ let paragraphStyle = NSMutableParagraphStyle ( )
108
+ paragraphStyle. lineHeightMultiple = 1.3
109
+ return paragraphStyle
110
+ } ( )
106
111
107
112
let titleLabel = UILabel ( )
108
113
let descriptionLabel = UILabel ( )
@@ -122,7 +127,6 @@ class InfoListCell: UITableViewCell {
122
127
123
128
private func configureCell( ) {
124
129
backgroundColor = . otpBackgroundColor
125
- selectionStyle = . none
126
130
127
131
titleLabel. textColor = . otpForegroundColor
128
132
titleLabel. font = InfoListCell . titleFont
@@ -135,6 +139,9 @@ class InfoListCell: UITableViewCell {
135
139
descriptionLabel. translatesAutoresizingMaskIntoConstraints = false
136
140
contentView. addSubview ( descriptionLabel)
137
141
142
+ selectedBackgroundView = UIView ( )
143
+ selectedBackgroundView? . backgroundColor = UIColor ( white: 0 , alpha: 0.25 )
144
+
138
145
setNeedsUpdateConstraints ( )
139
146
}
140
147
@@ -160,15 +167,11 @@ class InfoListCell: UITableViewCell {
160
167
// MARK: Update
161
168
162
169
func updateWithRowModel( _ rowModel: InfoList . RowModel ) {
163
- let paragraphStyle = NSMutableParagraphStyle ( )
164
- paragraphStyle. lineHeightMultiple = 1.3
165
-
166
- let attributedTitle = NSAttributedString ( string: rowModel. title,
167
- attributes: [ NSParagraphStyleAttributeName: paragraphStyle] )
168
- titleLabel. attributedText = attributedTitle
170
+ titleLabel. text = rowModel. title
169
171
172
+ let attributes = [ NSParagraphStyleAttributeName: InfoListCell . paragraphStyle]
170
173
let attributedDetails = NSMutableAttributedString ( string: rowModel. description + " " + rowModel. callToAction,
171
- attributes: [ NSParagraphStyleAttributeName : paragraphStyle ] )
174
+ attributes: attributes )
172
175
attributedDetails. addAttribute ( NSFontAttributeName, value: InfoListCell . callToActionFont,
173
176
range: ( attributedDetails. string as NSString ) . range ( of: rowModel. callToAction) )
174
177
descriptionLabel. attributedText = attributedDetails
0 commit comments