optonaut / ActiveLabel.swift

UILabel drop-in replacement supporting Hashtags (#), Mentions (@) and URLs (http://) written in Swift
MIT License
4.47k stars 686 forks source link

not working Attributed string with range #351

Closed tiskender2 closed 4 years ago

tiskender2 commented 4 years ago

let attributedText = NSMutableAttributedString(string: postContent) mentionRange = NSRange(location: 0, length: 10) attributedText.addAttribute(NSAttributedString.Key.underlineStyle , value:NSUnderlineStyle.single.rawValue, range: mentionRange!) attributedText.addAttribute(.backgroundColor , value: UIColor.red, range: NSMakeRange(0, 10)) activeLabel.attributedText = attributedText

instead of range it's set attributed whole text

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

gerchicov-bp commented 3 years ago

AND? It still doesn't work

Sejmet commented 3 years ago

AND?