0

I am trying to set a URL into UILabel such that the label is clickable by the user and opens in the phone's browser.

What is the way to do this?

I tried something like this but it errors out with unrecognized selector sent to instance

@url = q.append(UILabel, :url_label).get
@url.text = NSURL.URLWithString('http://www.rubymotion.com')

I preferably want to have a text that is clickable rather than showing a long url to the user.

Example: More Info rather than http://google.com

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Anthony
  • 33,838
  • 42
  • 169
  • 278
  • 1
    see http://stackoverflow.com/questions/8839464/uilabel-string-as-text-and-links – danh Apr 07 '14 at 04:30
  • 1
    check this one http://stackoverflow.com/questions/5928868/uilabel-with-a-hyperlink-inside-a-uitableviewcell-should-open-safari-webbrowser – Pradhyuman sinh Apr 07 '14 at 04:54
  • You need to use UITextView instead of UILabel. [see this question](http://stackoverflow.com/questions/10681965/how-to-make-url-phone-clickable-uilabel) – Vishal Sharma Apr 07 '14 at 05:00
  • use UITextview instead of UILabel it have options to detect links – NANNAV Apr 07 '14 at 05:19

0 Answers0