6

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.

jmurphy
  • 1,891
  • 3
  • 22
  • 28
  • Here is the answer http://stackoverflow.com/questions/14338229/ios-clickable-text-inside-uitextview#comment19930723_14338229 – zvjerka24 Jan 15 '13 at 14:29

3 Answers3

17

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

Sunil mathew
  • 186
  • 1
  • 2
4

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
  • 3,431
  • 4
  • 30
  • 31
0

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

Nathan de Vries
  • 15,481
  • 4
  • 49
  • 55