calling from within app

Hi there guys.

I need to be able to have a button that, when it is clicked, it will telprompt.

I need this as easy as possibly.

Please just post the this i will need to put in the:


@IBAction func callbutton(_ sender: Any) {

}


and the steps required. I need it as easy as possible to explain. eg where to inject the code, where the main "block" of code should be. etc.

I think I am using the swift language, because when i set it up it said language: swift.

Just post if you need more info.


Thanks guys,

drums86428

Replies

Reading your post I found it unclear as to what you’re trying to achieve here. I suspect you’re looking to add a button to your app that, when tapped, kicks off a phone call. If so you could do this by combined:

  • UIApplication’s

    openURL()
    method (or, better yet, its replacement,
    open(_:options:completionHandler:)
    )
  • Foundation’s

    URL
    type, which can be constructed from a string
  • The

    tel:
    URL scheme, as defined in Apple URL Scheme Reference

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"