Clickable text in UILabel
Asked Answered
D

1

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

Dextroamphetamine answered 3/1, 2012 at 18:1 Comment(0)
G
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.

Grearson answered 3/1, 2012 at 18:5 Comment(2)
Or subclass UILabel, set userInteractionEnabled, and implement touchesBegan:withEvent:. Or make it a custom UIButton and draw text on top.Comity
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.Dextroamphetamine

© 2022 - 2024 — McMap. All rights reserved.