URL Link selected font
nikeshakya opened this issue · comments
I have customized label to have bold font for url links
It works for the first time, but after the link is clicked, the font attribute just invalidates for link...it changes back to normal font
here is my implementation:
self.configureLinkAttribute = { (type, attributes, isSelected) in
var atts = attributes
switch type {
case .url:
if self.underlineLink {
atts[NSAttributedString.Key.underlineStyle] = NSUnderlineStyle.thick.rawValue
}
if let font = self.linkFont {
atts[NSAttributedString.Key.font] = font
}
break
default:
atts[NSAttributedString.Key.underlineStyle] = 0
break
}
return atts
}