Skip to content

Instantly share code, notes, and snippets.

@alexnikol
Created April 19, 2020 05:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexnikol/d65864812136a4d1edd18efa469b2f66 to your computer and use it in GitHub Desktop.
Save alexnikol/d65864812136a4d1edd18efa469b2f66 to your computer and use it in GitHub Desktop.
Swift 4. Run phone call from iOS Application
let yourNumber = "+1 999 999 9999" //Your needed phone
guard let number = URL(string: "tel://" + yourNumber), //Check if phone non-optional and app can open this URL
UIApplication.shared.canOpenURL(number) else { return }
UIApplication.shared.open(number) //Call your phone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment