开发者

NSMutableAttributedString and Adding a Link to text

开发者 https://www.devze.com 2023-02-09 13:15 出处:网络
I have a NSMutableAttributedString, Now I want to add Link to some portion of the text. how can i add a link to the tex开发者_JS百科t so that when the user touches the text i can fire some actions. I\

I have a NSMutableAttributedString, Now I want to add Link to some portion of the text. how can i add a link to the tex开发者_JS百科t so that when the user touches the text i can fire some actions. I'm working in iOS 4.2

Thanks in Advance. Shinto


I did a library a few months back that dealt with that exact use case. However, I had to re-use it last week and found out that CMTextLabel isn't very user-friendly.

https://github.com/pothibo/CMFramework/tree/master/CMKit/RichText

You could have a look at it. If you decide to use it and refactor some of it to make it easier to use, send a push request and I'll merge it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号