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

AttributedText issue in the latest version #111

Closed MarvinNazari closed 7 years ago

MarvinNazari commented 8 years ago

Hi i just updated to the latest version and found a problem with the attributedText that if i append an attributedLabel, it gets attributes of the first one! this didn't happen in 0.6.1

contentLabel.customize { label in
    label.numberOfLines = 0
    label.lineSpacing = 4
    label.textColor = UIColor(rgba: "#414548")
    label.font = UIFont.systemFontOfSize(14)
}
let userAttributed = name.attributedMutable(GlobalStyle.Cells.activityUserAttr)
userAttributed.appendAttributedString(" \(activity.text). ".attributed(GlobalStyle.Cells.activityContentAttr))
userAttributed.appendAttributedString(activity.timestamp.shortStringForComment.attributed(GlobalStyle.Cells.activityTimeAttr))
contentLabel.attributedText = userAttributed

and this is what i get in 0.6.1

screen shot 2016-09-15 at 16 47 12

this is what i get in 0.6.2

screen shot 2016-09-15 at 17 08 44

polqf commented 8 years ago

Hi @MarvinNazari , thanks for reporting the bug. There's been a few changes on how attributedText is used and treated now 🤔. ActiveLabel currently does not support setting text using attributedText, so that's the reason we have not this covered ATM.

That said, I'll take this bug into account, would be nice to have support for attributedText also. But I cannot asure you that I can provide a fix soon, for personal availability reasons. Feel free to open a PR if you find the solution.

ShawnBaek commented 8 years ago

@MarvinNazari I had changed swift3 from andreaperizzato's fork.

https://github.com/yoshiboarder/ActiveLabel.swift

It will be working fine in your projects

polqf commented 7 years ago

@yoshiboarder if you have a fix for that, I would be happy if you open a PR 😄

davidseek commented 7 years ago

any news on the attributed text issue?

phuocmobytelab commented 3 years ago

any fix now?

Sejmet commented 3 years ago

AND?