Reputation: 169
How to implement a UiLabel which can implement clickable text and urls, i need this to use in a twitter application
Upvotes: 2
Views: 2285
Reputation: 2092
You mean a clickable UILabel that behaves like a UIButton?
Make a new class that is descendant of UILabel and enalbe the userInteractionEnabled
to get touch events.
Upvotes: 1
Reputation: 44063
Try using a UIWebView
and use the delegate to deal with clicks.
NSString *html = @"<html><head><body><a href="http://www.apple.com>Click me</a></html>";
[webView loadHTMLString:html baseURL:nil];
You could also use a UIButton with no borders.
Upvotes: 2