iosiphonehyperlinkuilabeltttattributedlabel

iPhone -Remove the underline from link in UILabel


I am using TTTAttributedLabel (https://github.com/twotoasters/TTTAttributedLabel). Here I'm correctly getting the label with some clickable text.

enter image description here

I need to display my text like the username in above image(ie. without underline).How could I do that?


Solution

  • Try this code (sorry for formatting, written on phone...)

    NSDictionary *linkAttributes = @{[NSNumber numberWithInt:kCTUnderlineStyleNone] : (id)kCTUnderlineStyleAttributeName};
    self.label.linkAttributes = linkAttributes;