Atma
Atma

Reputation: 29767

iPhone Cocoa hyperlink

is there a way to display a hyperlink in an iPhone native app. Is this done with a label or another UI object?

Thanks! Joe

Upvotes: 6

Views: 5918

Answers (5)

Micah Hainline
Micah Hainline

Reputation: 14417

There is actually built-in support for this with a UITextView. Check out the accepted answer to this stackoverflow question: How to add hyperlink in iPhone app?

Upvotes: 1

catlan
catlan

Reputation: 25246

Take a look at Three20 TTStyledText class

Upvotes: 6

lostInTransit
lostInTransit

Reputation: 70997

Create a custom UIButton with only text (no background image) and write an IBAction on its click - you have a hyperlink...

Upvotes: 3

silicosaur
silicosaur

Reputation: 65

I suggest the following solution: Display the htperlink text as a label and put a detailed disclusure button after it. (Detailed disclosure button is an arrowhead in a circle (>). Set the button title to the url, and make an IBAction that handle the click of the button. In this action you can create a new UIWebView, display it and load the URL into it.

Upvotes: 1

Raj
Raj

Reputation: 6830

You can embed your text along with hyper link mark ups in a uiwebview object via a static HTML file. Another way is to show the link text on a uibutton and upon click of that button open safari to navigate to the link

Upvotes: 1

Related Questions