Search code examples
iosuibuttonnsattributedstring

Text with multiple buttons


Inside a tableview cell i want to display text like
Marc is now friends with Chris.
I want to use both Marc and Chris as buttons to navigate to their profile.

My first idea was to use NSAttributedString but i do not know if i can use the text as different buttons. I´m not a complete newbie so navigation works, display of cells works everything works. I am not asking for working code but i have no idea how to solve this... Maybe someone could tell me wich class could help me.

Thanks in advance.


Solution

  • Use TTTAttributedLabel from github. Provides this capability out of the box using various attributes on NSAttributedString