user1324265
user1324265

Reputation: 41

How to detect link from tweets in ios native app

I am showing tweets in an iOS native app. I am showing the tweets on the UILabel in a UITableView.

I want user able to click on the link that are part of tweet text.

But the links in tweet text are not prefix by http:// or www. Instead, the link contains @ and # as prefix.

I used UITextView with datadetector type property but not able to detect link. I read some article that the UIWebView can be use to detect link; but I don't think I should use UIWebView in UITableView cell.

Is there any way to achieve this in iOS? My app supports iOS 5+.

Upvotes: 0

Views: 140

Answers (1)

neilco
neilco

Reputation: 8012

There's nothing provided by the SDK that will do this out of the box, but the necessary pieces are there to build your own UILabel subclass that will handle this kind of data detection. If that's not something you want to take on, take a look at TTTAttributedLabel.

Upvotes: 1

Related Questions