views:

1334

answers:

3

Hello,

I'm wondering if it is possible to put a hyperlink in a UITextView that will open up safari and take the user to a web page. And if so how can I accomplish this.

Thanks in advance for your help.

+5  A: 

Unfortunately not at the moment since there are no attributes you can attach to the text.

You have a couple of options

1) Use a UIWebView instead.

2) If the text is in a known position then you could overlay a button on the coordinates. This is how Twitterific on the iPhone does links,

NeilInglis
+1  A: 

You should take a look at the TTStyledText class from Joe Hewitt's Three20 framework.

Nathan de Vries
+2  A: 

yes, you can by setting the dataDetectorTypes property pf the UITextView to 'UIDataDetectorTypeLink '.

Sunil mathew