How to detect link in UILabel in swift 4?
I was able to find out the solution for swift 4 as well.
label.configureLinkAttribute = { (type, attributes, isSelected) in
var atts = attributes
switch type {
case customType1:
atts[NSAttributedStringKey.font.rawValue] = UIFont(name: self.labelTc.font.fontName, size: 15.0)
atts[NSAttributedStringKey.underlineStyle.rawValue] = NSUnderlineStyle.styleSingle.rawValue
break
default: ()
}
return atts
}