Making a phone # clickable?

Discussion in 'iOS Programming' started by nottooshabby, Feb 19, 2009.

  1. nottooshabby macrumors 6502

    Jul 12, 2008
    So I know how to use openurl to make a button call a phone number or send an email, but is there a way to have a label that is a phone number be the button itself or be clickable? Do I need to make a custom invisible button behind the label that calls an ibaction function that contains the openurl command or is their a way to make the phone number look like a hyperlink so that the user would know they could click it to call the phone number? Hopefully this makes sense...
  2. bbrosemer macrumors 6502a


    Jan 28, 2006
    I am pretty sure it has to be a button ...
  3. firewood macrumors 604

    Jul 29, 2003
    Silicon Valley
    You could try sticking the number inside a UIWebView as an HTML link.
  4. drivefast macrumors regular

    Mar 13, 2008
    you may have already found the answer by now, but if you didnt. you can either ( a ) use your label like you use an UIView to handle touch events: UILabel inherits from UIView, as an effect you have all the UIView methods available or ( b ) use a button of type "custom", set the "title" property to whatever you wanted the label to say, and use the font properties to adjust color and underlining.
  5. nottooshabby thread starter macrumors 6502

    Jul 12, 2008
    Good call. I hadn't thought about (b). Thanks.... That should be easy enough.
  6. PhoneyDeveloper macrumors 68040


    Sep 2, 2008
    How do you adjust underlining with fonts? Is there a font on the iPhone that supports underlining?

Share This Page