0

I need to have a label with clickable text, I read answers here suggesting FancyLabel. Is there some new alternative to it? I know I could also use UIWebView for that but that would be to slow, is there some better way to achieve that? Thanks

Emanuele Fumagalli
  • 1,476
  • 2
  • 19
  • 31

1 Answers1

3

You could just set userInteractionEnabled to YES on it, then add a UITapGestureRecognizer to the UILabel to detect when someone taps on it.

If you want only part of the text to be clickable, then you're going to have to do a lot more work and would probably want to be a completely custom view which handles all of the business logic for doing something that complex.

mattjgalloway
  • 34,792
  • 12
  • 100
  • 110
  • Or subclass UILabel, set userInteractionEnabled, and implement touchesBegan:withEvent:. Or make it a custom UIButton and draw text on top. – Jano Jan 11 '12 at 12:18
  • ok, I expect some new library or sample code, I used Three20 in the past but it was a big library to use just for that feature. – Emanuele Fumagalli Jan 13 '12 at 14:54